From 3f9eadeaaf5d3a4b4e20c6e05dbad3fc4b4b5f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Thu, 29 Jun 2023 12:29:22 +0200 Subject: [PATCH] feat(UI): Add HDR label to resolution when the track is HDR (#5373) --- 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) {