From c56ba882a639ce87a36da0e4ec111860575862c0 Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Tue, 6 Feb 2024 01:06:34 +0800 Subject: [PATCH 1/2] Relax HEVC on Safari for hvc1/dvh1 direct-play Signed-off-by: nyanmisaka --- src/scripts/browserDeviceProfile.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/scripts/browserDeviceProfile.js b/src/scripts/browserDeviceProfile.js index 1f40349af4..aef1ca0050 100644 --- a/src/scripts/browserDeviceProfile.js +++ b/src/scripts/browserDeviceProfile.js @@ -583,11 +583,7 @@ export default function (options) { } if (canPlayHevc(videoTestElement, options)) { - // safari is lying on HDR and 60fps videos, use fMP4 instead - if (!browser.safari) { - mp4VideoCodecs.push('hevc'); - } - + mp4VideoCodecs.push('hevc'); if (browser.tizen || browser.web0s) { hlsInTsVideoCodecs.push('hevc'); } @@ -1098,6 +1094,25 @@ export default function (options) { }); } + // Safari quirks for HEVC direct-play + if (browser.safari) { + // Only hvc1 & dvh1 tags are supported + hevcCodecProfileConditions.push({ + Condition: 'EqualsAny', + Property: 'VideoCodecTag', + Value: 'hvc1|dvh1', + IsRequired: true + }); + + // Framerate above 60fps is not supported + hevcCodecProfileConditions.push({ + Condition: 'LessThanEqual', + Property: 'VideoFramerate', + Value: '60', + IsRequired: true + }); + } + // On iOS 12.x, for TS container max h264 level is 4.2 if (browser.iOS && browser.iOSVersion < 13) { const codecProfile = { From c7f925a9c621a2d6be7b954dcc3545943d065747 Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Tue, 6 Feb 2024 01:07:47 +0800 Subject: [PATCH 2/2] Enable client side tone-mapping on EdgeChromium 121+ Signed-off-by: nyanmisaka --- src/scripts/browserDeviceProfile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scripts/browserDeviceProfile.js b/src/scripts/browserDeviceProfile.js index aef1ca0050..2cdc0758bc 100644 --- a/src/scripts/browserDeviceProfile.js +++ b/src/scripts/browserDeviceProfile.js @@ -194,7 +194,8 @@ function supportsHdr10(options) { || browser.web0s || browser.safari && ((browser.iOS && browser.iOSVersion >= 11) || browser.osx) // Chrome mobile and Firefox have no client side tone-mapping - // Edge Chromium on Nvidia is known to have color issues on 10-bit video + // Edge Chromium 121+ fixed the tone-mapping color issue on Nvidia + || browser.edgeChromium && (browser.versionMajor >= 121) || browser.chrome && !browser.mobile ); }