From a16e662b3a1bfd8cfcc073e966e964190fd46bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=CC=81lvaro=20Velad=20Galva=CC=81n?= Date: Thu, 21 Nov 2024 16:24:00 +0100 Subject: [PATCH] fix(UI): Do not show codec name when the same codec is used for the same language --- ui/language_utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/language_utils.js b/ui/language_utils.js index dab269510d..059fec662d 100644 --- a/ui/language_utils.js +++ b/ui/language_utils.js @@ -14,6 +14,7 @@ goog.require('shaka.ui.Overlay.TrackLabelFormat'); goog.require('shaka.ui.Utils'); goog.require('shaka.util.Dom'); goog.require('shaka.util.LanguageUtils'); +goog.require('shaka.util.MimeUtils'); goog.requireType('shaka.ui.Localization'); @@ -48,7 +49,8 @@ shaka.ui.LanguageUtils = class { if (!codecsByLanguage.has(track.language)) { codecsByLanguage.set(track.language, new Set()); } - codecsByLanguage.get(track.language).add(track.audioCodec); + codecsByLanguage.get(track.language).add( + shaka.util.MimeUtils.getNormalizedCodec(track.audioCodec)); } const hasDifferentAudioCodecs = (language) => codecsByLanguage.has(language) && codecsByLanguage.get(language).size > 1;