diff options
author | Pale Moon <git-repo@palemoon.org> | 2017-09-07 11:33:40 +0200 |
---|---|---|
committer | Pale Moon <git-repo@palemoon.org> | 2017-09-07 11:33:40 +0200 |
commit | 4a463ba721cef6c9f1018597ba2cfaa21150a7ce (patch) | |
tree | a9c9daa1727b5de712bb43aca86a26e730b1a2de | |
parent | b2fca2a567fe2b824e2a90a8a522fc62c061d408 (diff) | |
download | palemoon-gre-4a463ba721cef6c9f1018597ba2cfaa21150a7ce.tar.gz |
Update UI controls for our current MSE/MP4/WebM implementation state.
-rw-r--r-- | browser/components/nsBrowserGlue.js | 5 | ||||
-rw-r--r-- | browser/components/preferences/content.js | 25 | ||||
-rw-r--r-- | browser/components/preferences/content.xul | 33 | ||||
-rw-r--r-- | browser/locales/en-US/chrome/browser/preferences/content.dtd | 2 |
4 files changed, 49 insertions, 16 deletions
diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 78149d151..0023bc9a8 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -432,6 +432,11 @@ BrowserGlue.prototype = { LoginManagerParent.init(); + // Make sure conflicting MSE prefs don't coexist + if (Services.prefs.getBoolPref('media.mediasource.format-reader', true)) { + Services.prefs.setBoolPref('media.mediasource.webm.enabled', false); + } + Services.obs.notifyObservers(null, "browser-ui-startup-complete", ""); }, diff --git a/browser/components/preferences/content.js b/browser/components/preferences/content.js index 1016d11e9..0775c6270 100644 --- a/browser/components/preferences/content.js +++ b/browser/components/preferences/content.js @@ -33,17 +33,38 @@ var gContentPane = { }, /** - * Utility function to enable/disable the checkboxes for MSE formats depending + * Utility function to enable/disable the checkboxes for MSE options depending * on the value of media.mediasource.enabled. */ updateMSE: function () { + var checkboxMSENFR = document.getElementById('videoMSENFR'); var checkboxMSEMP4 = document.getElementById('videoMSEMP4'); var checkboxMSEWebM = document.getElementById('videoMSEWebM'); var preference = document.getElementById('media.mediasource.enabled'); + checkboxMSENFR.disabled = preference.value != true; checkboxMSEMP4.disabled = preference.value != true; checkboxMSEWebM.disabled = preference.value != true; - return undefined; + // Check and disable WebM if necessary + if (preference.value == true) { + this.updateMSEWebM(); + } + }, + + /** + * Utility function to enable/disable the checkbox for MSE+WebM depending + * on the value of media.mediasource.format-reader. + */ + updateMSEWebM: function () + { + var checkboxMSEWebM = document.getElementById('videoMSEWebM'); + var preference = document.getElementById('media.mediasource.format-reader'); + checkboxMSEWebM.disabled = preference.value == true; + if (preference.value == true) { + // Switch off incompatible format + Services.prefs.setBoolPref('media.mediasource.webm.enabled', false); + checkboxMSEWebM.checked = false; + } }, // BEGIN UI CODE diff --git a/browser/components/preferences/content.xul b/browser/components/preferences/content.xul index 1ec8d8a3e..bd764e01b 100644 --- a/browser/components/preferences/content.xul +++ b/browser/components/preferences/content.xul @@ -33,9 +33,12 @@ onchange="gContentPane._rebuildFonts();"/> <!-- VIDEO --> - <preference id="media.mediasource.enabled" name="media.mediasource.enabled" type="bool"/> - <preference id="media.mediasource.mp4.enabled" name="media.mediasource.mp4.enabled" type="bool"/> - <preference id="media.mediasource.webm.enabled" name="media.mediasource.webm.enabled" type="bool"/> + <preference id="media.mediasource.enabled" name="media.mediasource.enabled" type="bool" + onchange="gContentPane.updateMSE();" /> + <preference id="media.mediasource.format-reader" name="media.mediasource.format-reader" type="bool" + onchange="gContentPane.updateMSEWebM();" /> + <preference id="media.mediasource.mp4.enabled" name="media.mediasource.mp4.enabled" type="bool"/> + <preference id="media.mediasource.webm.enabled" name="media.mediasource.webm.enabled" type="bool"/> </preferences> @@ -154,17 +157,19 @@ </groupbox> <!-- Video --> - <groupbox id="videoGroup"> - <caption label="&video.label;"/> - - <checkbox id="videoMSE" preference="media.mediasource.enabled" - label="&videoMSE.label;" accesskey="&videoMSE.accesskey;" - onsyncfrompreference="return gContentPane.updateMSE();"/> - <checkbox class="indent" id="videoMSEMP4" preference="media.mediasource.mp4.enabled" - label="&videoMSEMP4.label;" accesskey="&videoMSEMP4.accesskey;"/> - <checkbox class="indent" id="videoMSEWebM" preference="media.mediasource.webm.enabled" - label="&videoMSEWebM.label;" accesskey="&videoMSEWebM.accesskey;"/> - </groupbox> + <groupbox id="videoGroup"> + <caption label="&video.label;"/> + + <checkbox id="videoMSE" preference="media.mediasource.enabled" + label="&videoMSE.label;" accesskey="&videoMSE.accesskey;" + onsyncfrompreference="gContentPane.updateMSE();"/> + <checkbox class="indent" id="videoMSENFR" preference="media.mediasource.format-reader" ++ label="&videoMSENFR.label;" accesskey="&videoMSENFR.accesskey;"/> + <checkbox class="indent" id="videoMSEMP4" preference="media.mediasource.mp4.enabled" + label="&videoMSEMP4.label;" accesskey="&videoMSEMP4.accesskey;"/> + <checkbox class="indent" id="videoMSEWebM" preference="media.mediasource.webm.enabled" + label="&videoMSEWebM.label;" accesskey="&videoMSEWebM.accesskey;"/> + </groupbox> </prefpane> diff --git a/browser/locales/en-US/chrome/browser/preferences/content.dtd b/browser/locales/en-US/chrome/browser/preferences/content.dtd index 91abab069..928e599d8 100644 --- a/browser/locales/en-US/chrome/browser/preferences/content.dtd +++ b/browser/locales/en-US/chrome/browser/preferences/content.dtd @@ -33,6 +33,8 @@ <!ENTITY video.label "Video"> <!ENTITY videoMSE.label "Enable Media Source Extensions (MSE)"> <!ENTITY videoMSE.accesskey "M"> +<!ENTITY videoMSENFR.label "Use MSE asynchronously"> +<!ENTITY videoMSENFR.accesskey "U"> <!ENTITY videoMSEMP4.label "Enable MSE for MP4 video"> <!ENTITY videoMSEMP4.accesskey "4"> <!ENTITY videoMSEWebM.label "Enable MSE for WebM video"> |