diff options
author | Albin Larsson <mail@albinlarsson.com> | 2018-05-27 08:10:33 +0200 |
---|---|---|
committer | Albin Larsson <mail@albinlarsson.com> | 2018-05-28 06:08:03 +0200 |
commit | 813f703211230024b99f4de95e433e4d33119f9a (patch) | |
tree | 87709a93cc26dd802e3a582c211fc73a104ff03c /src/js/captions.js | |
parent | 7aad747c25b07fedf4a4fc75095c560ea3c9899c (diff) | |
download | plyr-813f703211230024b99f4de95e433e4d33119f9a.tar.lz plyr-813f703211230024b99f4de95e433e4d33119f9a.tar.xz plyr-813f703211230024b99f4de95e433e4d33119f9a.zip |
Add option to watch caption track changes and update language options
Diffstat (limited to 'src/js/captions.js')
-rw-r--r-- | src/js/captions.js | 5 |
1 files changed, 5 insertions, 0 deletions
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); }, |