@@ -78,10 +78,11 @@ shaka.ui.LanguageUtils = class {
78
78
} ;
79
79
80
80
const getCombination = ( language , rolesString , label , channelsCount ,
81
- audioCodec ) => {
81
+ audioCodec , spatialAudio ) => {
82
82
const keys = [
83
83
language ,
84
84
rolesString ,
85
+ spatialAudio ,
85
86
] ;
86
87
if ( showAudioChannelCountVariants && channelsCount != null ) {
87
88
keys . push ( channelsCount ) ;
@@ -136,7 +137,7 @@ shaka.ui.LanguageUtils = class {
136
137
const selectedCombination = selectedTrack ? getCombination (
137
138
selectedTrack . language , getRolesString ( selectedTrack ) ,
138
139
selectedTrack . label , selectedTrack . channelsCount ,
139
- selectedTrack . audioCodec ) : '' ;
140
+ selectedTrack . audioCodec , selectedTrack . spatialAudio ) : '' ;
140
141
141
142
for ( const track of tracks ) {
142
143
const language = track . language ;
@@ -146,9 +147,10 @@ shaka.ui.LanguageUtils = class {
146
147
const label = track . label ;
147
148
const channelsCount = track . channelsCount ;
148
149
const audioCodec = track . audioCodec ;
150
+ const spatialAudio = track . spatialAudio ;
149
151
const combinationName =
150
152
getCombination ( language , rolesString , label , channelsCount ,
151
- audioCodec ) ;
153
+ audioCodec , spatialAudio ) ;
152
154
if ( combinationsMade . has ( combinationName ) ) {
153
155
continue ;
154
156
}
@@ -164,25 +166,27 @@ shaka.ui.LanguageUtils = class {
164
166
165
167
span . textContent =
166
168
shaka . ui . LanguageUtils . getLanguageName ( language , localization ) ;
169
+ let basicInfo = '' ;
170
+ if ( showAudioCodec && showAudioChannelCountVariants &&
171
+ spatialAudio && audioCodec == 'ec-3' ) {
172
+ basicInfo += ' Dolby Atmos' ;
173
+ } else {
174
+ if ( showAudioCodec && hasDifferentAudioCodecs ( language ) ) {
175
+ basicInfo += getAudioCodecName ( audioCodec ) ;
176
+ }
177
+ if ( showAudioChannelCountVariants ) {
178
+ basicInfo += getChannelsCountName ( channelsCount ) ;
179
+ }
180
+ }
167
181
switch ( trackLabelFormat ) {
168
182
case shaka . ui . Overlay . TrackLabelFormat . LANGUAGE :
169
- if ( showAudioCodec && hasDifferentAudioCodecs ( language ) ) {
170
- span . textContent += getAudioCodecName ( audioCodec ) ;
171
- }
172
- if ( showAudioChannelCountVariants ) {
173
- span . textContent += getChannelsCountName ( channelsCount ) ;
174
- }
183
+ span . textContent += basicInfo ;
175
184
if ( forced ) {
176
185
span . textContent += ' (' + forcedString + ')' ;
177
186
}
178
187
break ;
179
188
case shaka . ui . Overlay . TrackLabelFormat . ROLE :
180
- if ( showAudioCodec && hasDifferentAudioCodecs ( language ) ) {
181
- span . textContent += getAudioCodecName ( audioCodec ) ;
182
- }
183
- if ( showAudioChannelCountVariants ) {
184
- span . textContent += getChannelsCountName ( channelsCount ) ;
185
- }
189
+ span . textContent += basicInfo ;
186
190
if ( ! rolesString ) {
187
191
// Fallback behavior. This probably shouldn't happen.
188
192
shaka . log . alwaysWarn ( 'Track #' + track . id + ' does not have a ' +
@@ -196,12 +200,7 @@ shaka.ui.LanguageUtils = class {
196
200
}
197
201
break ;
198
202
case shaka . ui . Overlay . TrackLabelFormat . LANGUAGE_ROLE :
199
- if ( showAudioCodec && hasDifferentAudioCodecs ( language ) ) {
200
- span . textContent += getAudioCodecName ( audioCodec ) ;
201
- }
202
- if ( showAudioChannelCountVariants ) {
203
- span . textContent += getChannelsCountName ( channelsCount ) ;
204
- }
203
+ span . textContent += basicInfo ;
205
204
if ( rolesString ) {
206
205
span . textContent += ': ' + rolesString ;
207
206
}
0 commit comments