File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ shaka.ui.AudioLanguageSelection = class extends shaka.ui.SettingsMenu {
63
63
64
64
/** @private */
65
65
onAudioTracksChanged_ ( ) {
66
- const audioTracks = this . player . getAudioTracks ( ) ;
66
+ const audioTracks = this . player . getAudioTracks ( ) || [ ] ;
67
67
68
68
shaka . ui . LanguageUtils . updateAudioTracks ( audioTracks , this . menu ,
69
69
( track ) => this . onAudioTrackSelected_ ( track ) ,
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu {
112
112
113
113
/** @private */
114
114
updateResolutionLabels_ ( ) {
115
- const tracks = this . player . getVariantTracks ( ) ;
115
+ const tracks = this . player . getVariantTracks ( ) || [ ] ;
116
116
const track = tracks . find ( ( track ) => track . active ) ;
117
117
if ( ! track ) {
118
118
if ( this . overflowQualityMark ) {
@@ -184,7 +184,7 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu {
184
184
// When played with src=, the variant tracks available from
185
185
// player.getVariantTracks() represent languages, not resolutions.
186
186
if ( this . player . getLoadMode ( ) != shaka . Player . LoadMode . SRC_EQUALS ) {
187
- tracks = this . player . getVariantTracks ( ) ;
187
+ tracks = this . player . getVariantTracks ( ) || [ ] ;
188
188
}
189
189
190
190
// If there is a selected variant track, then we filter out any tracks in
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ shaka.ui.TextSelection = class extends shaka.ui.SettingsMenu {
128
128
129
129
/** @private */
130
130
updateTextLanguages_ ( ) {
131
- const tracks = this . player . getTextTracks ( ) ;
131
+ const tracks = this . player . getTextTracks ( ) || [ ] ;
132
132
133
133
shaka . ui . LanguageUtils . updateTextTracks ( tracks , this . menu ,
134
134
( track ) => this . onTextTrackSelected_ ( track ) ,
@@ -206,7 +206,8 @@ shaka.ui.TextSelection = class extends shaka.ui.SettingsMenu {
206
206
207
207
/** @private */
208
208
onTracksChanged_ ( ) {
209
- const hasText = this . player . getTextTracks ( ) . length > 0 ;
209
+ const tracks = this . player . getTextTracks ( ) || [ ] ;
210
+ const hasText = tracks . length > 0 ;
210
211
shaka . ui . Utils . setDisplay ( this . button , hasText ) ;
211
212
this . updateTextLanguages_ ( ) ;
212
213
}
You can’t perform that action at this time.
0 commit comments