<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<!DOCTYPE overlay [
<!ENTITY % mediaDTD SYSTEM "chrome://communicator/locale/pref/pref-media.dtd">
%mediaDTD;
]>

<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <prefpane id="media_pane"
            label="&pref.media.title;"
            script="chrome://communicator/content/pref/pref-media.js">

  <preferences id="media_preferences">
    <preference id="permissions.default.image"
                name="permissions.default.image"
                type="int"/>
    <preference id="image.animation_mode"
                name="image.animation_mode"
                type="string"/>
    <preference id="pref.advanced.images.disable_button.view_image"
                name="pref.advanced.images.disable_button.view_image"
                type="bool"/>

    <preference id="media.autoplay.enabled"
                name="media.autoplay.enabled"
                type="bool"/>

    <preference id="media.mediasource.enabled"
                name="media.mediasource.enabled"
                type="bool"
                onchange="updateMSE(event.target)"/>
    <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.av1.enabled"
                name="media.av1.enabled"
                type="bool"/>
    <preference id="media.flac.enabled"
                name="media.flac.enabled"
                type="bool"/>
    <preference id="media.mp4.enabled"
                name="media.mp4.enabled"
                type="bool"/>
    <preference id="media.ogg.enabled"
                name="media.ogg.enabled"
                type="bool"/>
    <preference id="media.opus.enabled"
                name="media.opus.enabled"
                type="bool"/>
    <preference id="media.webm.enabled"
                name="media.webm.enabled"
                type="bool"/>
  </preferences>

    <groupbox id="imagesArea">
      <caption label="&imageBlocking.label;"/>
      <radiogroup id="networkImageBehaviour"
                  preference="permissions.default.image">
        <radio value="2" label="&loadNoImagesRadio.label;"
               accesskey="&loadNoImagesRadio.accesskey;"/>
        <radio value="3" label="&loadOrgImagesRadio.label;"
               accesskey="&loadOrgImagesRadio.accesskey;"/>
        <radio value="1" label="&loadAllImagesRadio.label;"
               accesskey="&loadAllImagesRadio.accesskey;"/>
      </radiogroup>

      <hbox pack="end">
        <button id="viewImages"
                label="&viewPermissions.label;"
                accesskey="&viewPermissions.accesskey;"
                oncommand="toPermissionsManager('image');"
                preference="pref.advanced.images.disable_button.view_image"/>
      </hbox>
    </groupbox>

    <groupbox>
      <caption label="&animLoopingTitle.label;"/>
      <radiogroup id="imageLooping"
                  preference="image.animation_mode">
        <radio value="normal" label="&animLoopAsSpecified.label;"
               accesskey="&animLoopAsSpecified.accesskey;"/>
        <radio value="once" label="&animLoopOnce.label;"
               accesskey="&animLoopOnce.accesskey;"/>
        <radio value="none" label="&animLoopNever.label;"
               accesskey="&animLoopNever.accesskey;"/>
      </radiogroup>
    </groupbox>

    <groupbox id="mediaSettings" align="start">
      <caption label="&mediaSettings.label;"/>
      <checkbox id="enableAutoPlay"
                label="&enableAutoPlay.label;"
                accesskey="&enableAutoPlay.accesskey;"
                preference="media.autoplay.enabled"/>
      <checkbox id="enableMediaSource"
                label="&enableMediaSource.label;"
                accesskey="&enableMediaSource.accesskey;"
                preference="media.mediasource.enabled"/>
      <checkbox id="enableMediaSourceMP4" class="indent"
                label="&enableMediaSourceMP4.label;"
                accesskey="&enableMediaSourceMP4.accesskey;"
                preference="media.mediasource.mp4.enabled"/>
      <checkbox id="enableMediaSourceWebM" class="indent"
                label="&enableMediaSourceWebM.label;"
                accesskey="&enableMediaSourceWebM.accesskey;"
                preference="media.mediasource.webm.enabled"/>
    </groupbox>

    <groupbox id="mediaSupport" align="start">
      <caption label="&mediaSupport.label;"/>
      <hbox align="center">
        <label id="allowEnable"
               value="&allowEnable.label;"/>
#ifdef MOZ_FMP4
        <checkbox id="enableMP4"
                  label="&enableMP4.label;"
                  preference="media.mp4.enabled"/>
#endif
        <checkbox id="enableWebM"
                  label="&enableWebM.label;"
                  preference="media.webm.enabled"/>
#ifdef MOZ_AV1
        <checkbox id="enableAV1"
                  label="&enableAV1.label;"
                  preference="media.av1.enabled"/>
#endif
        <checkbox id="enableOGG"
                  label="&enableOGG.label;"
                  preference="media.ogg.enabled"/>
        <checkbox id="enableOPUS"
                  label="&enableOPUS.label;"
                  preference="media.opus.enabled"/>
        <checkbox id="enableFLAC"
                  label="&enableFLAC.label;"
                  preference="media.flac.enabled"/>
      </hbox>
    </groupbox>

  </prefpane>
</overlay>
