diff options
author | Moonchild <moonchild@palemoon.org> | 2022-07-29 13:10:12 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-07-29 13:10:12 +0000 |
commit | 900107da1bea93a20765202169a5fc0b9620858e (patch) | |
tree | c7fc9e58d813be58fd0aede089de2ef9a1353c17 | |
parent | b6734006391fbd757220e17cade7a7afd33ac6bc (diff) | |
parent | 8a10b7bf8b45952f862f07842d0efb12c4feff04 (diff) | |
download | uxp-900107da1bea93a20765202169a5fc0b9620858e.tar.gz |
Merge pull request 'Allow WAV into media document.' (#1978) from jobbautista9/UXP:1977-wav-videodocument into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1978
Reviewed-by: Moonchild <moonchild@palemoon.org>
-rw-r--r-- | dom/media/DecoderTraits.cpp | 19 | ||||
-rw-r--r-- | modules/libpref/init/all.js | 4 |
2 files changed, 15 insertions, 8 deletions
diff --git a/dom/media/DecoderTraits.cpp b/dom/media/DecoderTraits.cpp index 6aa44f3e57..d4968c0b4e 100644 --- a/dom/media/DecoderTraits.cpp +++ b/dom/media/DecoderTraits.cpp @@ -278,18 +278,20 @@ DecoderTraits::CanHandleContentType(const MediaContentType& aContentType, bool DecoderTraits::ShouldHandleMediaType(const char* aMIMEType, DecoderDoctorDiagnostics* aDiagnostics) { - if (IsWaveSupportedType(nsDependentCString(aMIMEType))) { - // We should not return true for Wave types, since there are some - // Wave codecs actually in use in the wild that we don't support, and - // we should allow those to be handled by plugins or helper apps. - // Furthermore people can play Wave files on most platforms by other - // means. + // 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 && @@ -414,6 +416,7 @@ bool DecoderTraits::IsSupportedInVideoDocument(const nsACString& aType) #endif IsMP3SupportedType(aType) || IsAACSupportedType(aType) || + IsWaveSupportedType(aType) || IsFlacSupportedType(aType) || false; } 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); |