Skip to content

Commit

Permalink
fix(UI): Only show frame rate if there are several frame rates (#7190)
Browse files Browse the repository at this point in the history
Fixes #7187
  • Loading branch information
avelad committed Aug 22, 2024
1 parent 200497f commit c25062c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ui/resolution_selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,17 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu {
if (height == 2160) {
text = '4K';
}
const frameRate = track.frameRate;
if (frameRate && (frameRate >= 50 || frameRate <= 20)) {
text += Math.round(track.frameRate);
const frameRates = new Set();
for (const item of tracks) {
if (item.frameRate) {
frameRates.add(Math.round(item.frameRate));
}
}
if (frameRates.size > 1) {
const frameRate = track.frameRate;
if (frameRate && (frameRate >= 50 || frameRate <= 20)) {
text += Math.round(track.frameRate);
}
}
if (track.hdr == 'PQ' || track.hdr == 'HLG') {
text += ' (HDR)';
Expand Down

0 comments on commit c25062c

Please sign in to comment.