diff options
author | Job Bautista <jobbautista9@protonmail.com> | 2022-07-29 20:14:27 +0800 |
---|---|---|
committer | Job Bautista <jobbautista9@protonmail.com> | 2022-07-29 20:14:27 +0800 |
commit | 8a10b7bf8b45952f862f07842d0efb12c4feff04 (patch) | |
tree | 7067b4efc387d4756dfa2f8bad3e828370512e9f | |
parent | 28e73defa3021293bfd220bbceed04d04fd169e7 (diff) | |
download | uxp-8a10b7bf8b45952f862f07842d0efb12c4feff04.tar.gz |
Issue #1977 - Bring back old behavior behind a pref.
I've thought about this before creating the issue, and Moonchild
wanted this as well.
-rw-r--r-- | dom/media/DecoderTraits.cpp | 15 | ||||
-rw-r--r-- | modules/libpref/init/all.js | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/dom/media/DecoderTraits.cpp b/dom/media/DecoderTraits.cpp index 19596572a0..d4968c0b4e 100644 --- a/dom/media/DecoderTraits.cpp +++ b/dom/media/DecoderTraits.cpp @@ -278,9 +278,20 @@ DecoderTraits::CanHandleContentType(const MediaContentType& aContentType, bool DecoderTraits::ShouldHandleMediaType(const char* aMIMEType, DecoderDoctorDiagnostics* aDiagnostics) { + // Prior to Issue #1977, we always pop-up the download prompt when + // wave files are opened directly. This was considered inconsistent + // since we play wave files when they're inside an HTML5 audio tag + // anyway. However, there may be users who depended on this old + // behavior, where they use their helper apps to open WAV audio + // instead. We should allow this old behavior behind a pref for + // those who want it. + if (!Preferences::GetBool("media.wave.play-stand-alone", true)) { + return false; + } + // If an external plugin which can handle quicktime video is available - // (and not disabled), prefer it over native playback as there several - // codecs found in the wild that we do not handle. + // (and not disabled), prefer it over native playback as there are + // several codecs found in the wild that we do not handle. if (nsDependentCString(aMIMEType).EqualsASCII("video/quicktime")) { RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst(); if (pluginHost && diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index d17082364a..4a57e5fcaa 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -361,6 +361,10 @@ pref("media.wakelock_timeout", 2000); // opened as top-level documents, as opposed to inside a media element. pref("media.play-stand-alone", true); +// Whether we should play wave files opened in a "media document", i.e. wave +// audio opened as top-level documents, as opposed to inside a media element. +pref("media.wave.play-stand-alone", true); + pref("media.hardware-video-decoding.enabled", true); pref("media.hardware-video-decoding.force-enabled", false); |