Bug 1188240 - Disable auto-playing of media without user consent on Android 2.3-4.0. r=rbarker, a=al
authorEugen Sawin <esawin@mozilla.com>
Mon, 12 Oct 2015 10:26:34 +0200
changeset 298087 9529a0efe7e68ba783cac6a91b2093613876887d
parent 298086 304c71a047eb93d95924e8df176f340055513ef9
child 298088 446a398ed58e6bd0f98139a0fb84e62c53048417
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrbarker, al
bugs1188240
milestone43.0a2
Bug 1188240 - Disable auto-playing of media without user consent on Android 2.3-4.0. r=rbarker, a=al
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -520,16 +520,22 @@ var BrowserApp = {
       Services.prefs.setIntPref("extensions.autoDisableScopes", 1);
       Services.prefs.setBoolPref("xpinstall.enabled", false);
     } else if (ParentalControls.parentalControlsEnabled) {
       Services.prefs.clearUserPref("extensions.enabledScopes");
       Services.prefs.clearUserPref("extensions.autoDisableScopes");
       Services.prefs.setBoolPref("xpinstall.enabled", true);
     }
 
+    let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
+    if (sysInfo.get("version") < 16) {
+      let defaults = Services.prefs.getDefaultBranch(null);
+      defaults.setBoolPref("media.autoplay.enabled", false);
+    }
+
     try {
       // Set the tiles click observer only if tiles reporting is enabled (that
       // is, a report URL is set in prefs).
       gTilesReportURL = Services.prefs.getCharPref("browser.tiles.reportURL");
       Services.obs.addObserver(this, "Tiles:Click", false);
     } catch (e) {
       // Tiles reporting is disabled.
     }