From 18917564267bc3ac6a9e9f85b0dc49d8461c3d9d Mon Sep 17 00:00:00 2001 From: Alvaro Velad Galvan Date: Thu, 29 Jun 2023 11:58:36 +0200 Subject: [PATCH] feat(UI): Add HDR label to resolution when the track is HDR --- ui/resolution_selection.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/resolution_selection.js b/ui/resolution_selection.js index f89e3528ba..e65e538b5b 100644 --- a/ui/resolution_selection.js +++ b/ui/resolution_selection.js @@ -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) {