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