Defer initial captions update to next tick, to avoid event being triggered to early

This commit is contained in:
Albin Larsson
2018-05-28 17:54:25 +02:00
parent f58e23b325
commit 64399e0717

View File

@ -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() {