1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Support HDR in Firefox for macOS

Firefox 100 introduced HDR playback:
  * https://www.mozilla.org/en-US/firefox/100.0/releasenotes/

This patches the issue where HDR detection is broken for HDR videos in
VP9 (video codec) in an MP4 container:
  * https://bugzilla.mozilla.org/show_bug.cgi?id=1915265
This commit is contained in:
Christopher Tam 2024-08-27 17:33:33 -04:00 committed by Chris Tam
parent bbbbd0c4f5
commit e4fc8e811a

View file

@ -225,6 +225,12 @@ function supportsHdr10(options) {
// Edge Chromium 121+ fixed the tone-mapping color issue on Nvidia
|| browser.edgeChromium && (browser.versionMajor >= 121)
|| browser.chrome && !browser.mobile
// Firefox 100+ has support for HDR on macOS/OS X. It requires OS support, which was
// added in macOS 10.15 Catalina. If enabling HDR on other platforms, be careful about
// allowing HDR VP9 in mp4 containers.
// * https://www.mozilla.org/en-US/firefox/100.0/releasenotes/
// * https://bugzilla.mozilla.org/show_bug.cgi?id=1915265
|| browser.firefox && browser.osx && (!browser.iphone && !browser.ipod && !browser.ipad) && (browser.versionMajor >= 100)
);
}
@ -660,8 +666,12 @@ export default function (options) {
}
if (canPlayVp9) {
if (!browser.iOS) {
if (!browser.iOS && (!browser.firefox || !browser.osx)) {
// iOS safari may fail to direct play vp9 in mp4 container
//
// Firefox can play vp9 in mp4 container but fails to detect HDR. Since HDR is
// unsupported for all other non-Mac platforms, it's fine to allow vp9 in mp4 for them.
// * https://bugzilla.mozilla.org/show_bug.cgi?id=1915265
mp4VideoCodecs.push('vp9');
}
// Only iOS Safari's native HLS player understands vp9 in fmp4