From b5e40f5952153245cbdcf982ce8551bb47a40f32 Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Sun, 24 Mar 2024 01:59:54 +0800 Subject: [PATCH] Fix the behavior of HDR remuxing in HLS.js 1.5+ Without this change, HLS.js 1.5+ only allows HDR playback on displays/systems with HDR enabled. When the server provides two streams one HDR and one SDR for fallback, HLS.js will ignore the HDR stream, even if the browser supports client-side tone-mapping. This triggers unnecessary transcoding. Signed-off-by: nyanmisaka --- src/plugins/htmlVideoPlayer/plugin.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index 41f0528d58..eb659abb67 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -443,6 +443,7 @@ export class HtmlVideoPlayer { startPosition: options.playerStartPositionTicks / 10000000, manifestLoadingTimeOut: 20000, maxBufferLength: maxBufferLength, + videoPreference: { preferHDR: true }, xhrSetup(xhr) { xhr.withCredentials = includeCorsCredentials; }