Add option to watch caption track changes and update language options

This commit is contained in:
Albin Larsson
2018-05-27 08:10:33 +02:00
parent 7aad747c25
commit 813f703211
3 changed files with 9 additions and 1 deletions

View File

@ -83,6 +83,11 @@ const captions = {
// Set toggled state
this.toggleCaptions(active);
// Watch changes to textTracks and update captions menu
if (this.config.captions.update) {
utils.on(this.media.textTracks, 'change', captions.update.bind(this));
}
// Update available languages in list
captions.update.call(this);
},