Skip to content

Commit 8284eec

Browse files
aveladjoeyparrish
authored andcommitted
fix: Fix select HLG tracks when using AUTO hdr level (#7470)
Fixes #7468
1 parent c7f386d commit 8284eec

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/media/adaptation_set_criteria.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,14 @@ shaka.media.PreferenceBasedCriteria = class {
356356
if (hdrLevel == 'AUTO') {
357357
// Auto detect the ideal HDR level.
358358
if (window.matchMedia('(color-gamut: p3)').matches) {
359-
hdrLevel = 'PQ';
359+
const someHLG = variants.some((variant) => {
360+
if (variant.video && variant.video.hdr &&
361+
variant.video.hdr == 'HLG') {
362+
return true;
363+
}
364+
return false;
365+
});
366+
hdrLevel = someHLG ? 'HLG' : 'PQ';
360367
} else {
361368
hdrLevel = 'SDR';
362369
}

0 commit comments

Comments
 (0)