Skip to content

Commit

Permalink
fix: Fix select HLG tracks when using AUTO hdr level (#7470)
Browse files Browse the repository at this point in the history
Fixes #7468
  • Loading branch information
avelad authored and joeyparrish committed Nov 12, 2024
1 parent c7f386d commit 8284eec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/media/adaptation_set_criteria.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,14 @@ shaka.media.PreferenceBasedCriteria = class {
if (hdrLevel == 'AUTO') {
// Auto detect the ideal HDR level.
if (window.matchMedia('(color-gamut: p3)').matches) {
hdrLevel = 'PQ';
const someHLG = variants.some((variant) => {
if (variant.video && variant.video.hdr &&
variant.video.hdr == 'HLG') {
return true;
}
return false;
});
hdrLevel = someHLG ? 'HLG' : 'PQ';
} else {
hdrLevel = 'SDR';
}
Expand Down

0 comments on commit 8284eec

Please sign in to comment.