From 813f703211230024b99f4de95e433e4d33119f9a Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Sun, 27 May 2018 08:10:33 +0200 Subject: Add option to watch caption track changes and update language options --- src/js/captions.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/js/captions.js') diff --git a/src/js/captions.js b/src/js/captions.js index 296888b2..5941ebda 100644 --- a/src/js/captions.js +++ b/src/js/captions.js @@ -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); }, -- cgit v1.2.3