Defer initial captions update to next tick, to avoid event being triggered to early
This commit is contained in:
@ -77,8 +77,8 @@ const captions = {
|
|||||||
utils.on(this.media.textTracks, 'addtrack removetrack', captions.update.bind(this));
|
utils.on(this.media.textTracks, 'addtrack removetrack', captions.update.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update available languages in list
|
// Update available languages in list next tick (the event must not be triggered before the listeners)
|
||||||
captions.update.call(this);
|
setTimeout(captions.update.bind(this), 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
|
Reference in New Issue
Block a user