mirror of
https://github.com/videojs/video.js.git
synced 2025-02-10 12:08:14 +02:00
fix(text-tracks): keep showing captions even if the text track settings were disabled (#4974)
If a user disabled the text track setting component, trying to play emulated captions would crash. Add a null check before applying the text track settings. Fixes #4964.
This commit is contained in:
parent
9c4ded8899
commit
7facc44893
@ -270,7 +270,6 @@ class TextTrackDisplay extends Component {
|
||||
return;
|
||||
}
|
||||
|
||||
const overrides = this.player_.textTrackSettings.getValues();
|
||||
const cues = [];
|
||||
|
||||
for (let i = 0; i < track.activeCues.length; i++) {
|
||||
@ -279,6 +278,12 @@ class TextTrackDisplay extends Component {
|
||||
|
||||
window.WebVTT.processCues(window, cues, this.el_);
|
||||
|
||||
if (!this.player_.textTrackSettings) {
|
||||
return;
|
||||
}
|
||||
|
||||
const overrides = this.player_.textTrackSettings.getValues();
|
||||
|
||||
let i = cues.length;
|
||||
|
||||
while (i--) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user