Skip to content

Commit

Permalink
feat(UI): Add HDR label to resolution when the track is HDR (shaka-pr…
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Jun 29, 2023
1 parent 2f511a2 commit 3f9eade
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ui/resolution_selection.js
Expand Up @@ -132,8 +132,15 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu {
() => this.onTrackSelected_(track));

const span = shaka.util.Dom.createHTMLElement('span');
span.textContent = this.player.isAudioOnly() ?
Math.round(track.bandwidth / 1000) + ' kbits/s' : track.height + 'p';
if (this.player.isAudioOnly()) {
span.textContent = Math.round(track.bandwidth / 1000) + ' kbits/s';
} else {
if (track.hdr == 'PQ' || track.hdr == 'HLG') {
span.textContent = track.height + 'p (HDR)';
} else {
span.textContent = track.height + 'p';
}
}
button.appendChild(span);

if (!abrEnabled && track == selectedTrack) {
Expand Down

0 comments on commit 3f9eade

Please sign in to comment.