Bug 1217170: [MSE] P2. Enable WebM/MSE on systems with no MP4/H264 support. r=kentuckyfriedtakahe

This commit is contained in:
Jean-Yves Avenard 2015-10-27 12:52:28 +11:00
parent ea7721dc38
commit 75880b3792

View File

@ -69,6 +69,21 @@ static const char* const gMediaSourceTypes[6] = {
nullptr
};
// Returns true if we should enable MSE webm regardless of preferences.
// 1. If MP4/H264 isn't supported:
// * Windows XP
// * Windows Vista and Server 2008 without the optional "Platform Update Supplement"
// * N/KN editions (Europe and Korea) of Windows 7/8/8.1/10 without the
// optional "Windows Media Feature Pack"
static bool
IsWebMForced()
{
bool mp4supported =
DecoderTraits::IsMP4TypeAndEnabled(NS_LITERAL_CSTRING("video/mp4"));
return !mp4supported;
}
static nsresult
IsTypeSupported(const nsAString& aType)
{
@ -99,7 +114,8 @@ IsTypeSupported(const nsAString& aType)
}
return NS_OK;
} else if (DecoderTraits::IsWebMTypeAndEnabled(mimeTypeUTF8)) {
if (!Preferences::GetBool("media.mediasource.webm.enabled", false)) {
if (!(Preferences::GetBool("media.mediasource.webm.enabled", false) ||
IsWebMForced())) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
if (hasCodecs &&