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 Oct 23, 2024
1 parent afe7d37 commit 322ea6b
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 @@ -369,7 +369,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 322ea6b

Please sign in to comment.