Skip to content

Commit

Permalink
fix(UI): Update UI in order to support AC-4 (#8205)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored Mar 4, 2025
1 parent 3086df0 commit 051da08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/util/mime_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ shaka.util.MimeUtils = class {
static getNormalizedCodec(codecString) {
const parts =
shaka.util.MimeUtils.getCodecParts_(codecString);
const base = parts[0];
const base = parts[0].toLowerCase();
const profile = parts[1].toLowerCase();
switch (true) {
case base === 'mp4a' && profile === '69':
Expand Down
10 changes: 6 additions & 4 deletions ui/language_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,14 @@ shaka.ui.LanguageUtils = class {

const getAudioCodecName = (audioCodec) => {
let name = '';
audioCodec = audioCodec.toLowerCase();
if (audioCodec.startsWith('mp4a')) {
if (audioCodec == 'aac') {
name = 'AAC';
} else if (audioCodec === 'ac-3') {
name = 'Dolby';
} else if (audioCodec === 'ec-3') {
name = 'DD+';
} else if (audioCodec === 'ac-4') {
name = 'Dolby AC-4';
} else if (audioCodec === 'opus') {
name = 'Opus';
} else if (audioCodec === 'flac') {
Expand Down Expand Up @@ -140,7 +141,8 @@ shaka.ui.LanguageUtils = class {
const rolesString = getRolesString(track);
const label = track.label;
const channelsCount = track.channelsCount;
const audioCodec = track.codecs;
const audioCodec = track.codecs &&
shaka.util.MimeUtils.getNormalizedCodec(track.codecs);
const spatialAudio = track.spatialAudio;
const combinationName =
getCombination(language, rolesString, label, channelsCount,
Expand All @@ -162,7 +164,7 @@ shaka.ui.LanguageUtils = class {
shaka.ui.LanguageUtils.getLanguageName(language, localization);
let basicInfo = '';
if (showAudioCodec && showAudioChannelCountVariants &&
spatialAudio && audioCodec == 'ec-3') {
spatialAudio && (audioCodec == 'ec-3' || audioCodec == 'ac-4')) {
basicInfo += ' Dolby Atmos';
} else {
if (showAudioCodec && hasDifferentAudioCodecs(language)) {
Expand Down

0 comments on commit 051da08

Please sign in to comment.