Bug 1084456 - Enable MSE on Android r=ajones,ehsan

This commit is contained in:
James Willcox 2015-05-06 09:52:56 -05:00
parent aae84aa1d5
commit 719abb1297
3 changed files with 18 additions and 6 deletions

View File

@ -33,6 +33,10 @@
#include "prlog.h"
#include "nsServiceManagerUtils.h"
#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#endif
struct JSContext;
class JSObject;
@ -87,7 +91,12 @@ IsTypeSupported(const nsAString& aType)
if (mimeType.EqualsASCII(gMediaSourceTypes[i])) {
if ((mimeType.EqualsASCII("video/mp4") ||
mimeType.EqualsASCII("audio/mp4")) &&
!Preferences::GetBool("media.mediasource.mp4.enabled", false)) {
(!Preferences::GetBool("media.mediasource.mp4.enabled", false)
#ifdef MOZ_WIDGET_ANDROID
// MP4 won't work unless we have JellyBean+
|| AndroidBridge::Bridge()->GetAPIVersion() < 16
#endif
)) {
break;
}
if ((mimeType.EqualsASCII("video/webm") ||

View File

@ -689,7 +689,7 @@ var interfaceNamesInGlobalScope =
// IMPORTANT: Do not change this list without review from a DOM peer!
"MediaRecorder",
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MediaSource", android: false, linux: false, release: false},
{name: "MediaSource", android: true, linux: false, release: false},
// IMPORTANT: Do not change this list without review from a DOM peer!
"MediaStream",
// IMPORTANT: Do not change this list without review from a DOM peer!
@ -933,9 +933,9 @@ var interfaceNamesInGlobalScope =
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SimpleTest", xbl: false},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SourceBuffer", android: false, linux: false, release: false},
{name: "SourceBuffer", android: true, linux: false, release: false},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SourceBufferList", android: false, linux: false, release: false},
{name: "SourceBufferList", android: true, linux: false, release: false},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SpeechSynthesisEvent", b2g: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
@ -1287,7 +1287,7 @@ var interfaceNamesInGlobalScope =
// IMPORTANT: Do not change this list without review from a DOM peer!
"ValidityState",
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "VideoPlaybackQuality", android: false, linux: false, release: false},
{name: "VideoPlaybackQuality", android: true, linux: false, release: false},
// IMPORTANT: Do not change this list without review from a DOM peer!
"VideoStreamTrack",
// IMPORTANT: Do not change this list without review from a DOM peer!
@ -1390,8 +1390,8 @@ function createInterfaceMap(isXBLScope) {
var isB2G = !isDesktop && !navigator.userAgent.includes("Android");
var isMac = /Mac OS/.test(navigator.oscpu);
var isWindows = /Windows/.test(navigator.oscpu);
var isLinux = /Linux/.test(navigator.oscpu);
var isAndroid = navigator.userAgent.includes("Android");
var isLinux = /Linux/.test(navigator.oscpu) && !isAndroid;
var hasPermission = function (aPermissions) {
var result = false;
for (var p of aPermissions) {

View File

@ -569,6 +569,9 @@ pref("media.fragmented-mp4.enabled", true);
pref("media.fragmented-mp4.android-media-codec.enabled", true);
pref("media.fragmented-mp4.android-media-codec.preferred", true);
// Enable MSE
pref("media.mediasource.enabled", true);
// optimize images memory usage
pref("image.downscale-during-decode.enabled", true);
pref("image.decode-only-on-draw.enabled", true);