From 211db12a3d6c251f79f3e081ebe2575aef7d2e67 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Tue, 6 Feb 2018 11:06:46 +1100 Subject: Readme merge --- src/js/captions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/js/captions.js') diff --git a/src/js/captions.js b/src/js/captions.js index 847ef7ff..13244f12 100644 --- a/src/js/captions.js +++ b/src/js/captions.js @@ -78,7 +78,7 @@ const captions = { // Setup HTML5 track rendering if (this.isHTML5 && this.isVideo) { captions.getTracks.call(this).forEach(track => { - // Remove previous bindings + // Show track utils.on(track, 'cuechange', event => captions.setCue.call(this, event)); // Turn off native caption rendering to avoid double captions -- cgit v1.2.3 From 98adb8e7841c08758e26d51278eb0c5cfc7af5c4 Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Tue, 6 Feb 2018 02:39:01 +0100 Subject: Fix harmless but annoying IE error 'IndexSizeError' --- src/js/captions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/js/captions.js') diff --git a/src/js/captions.js b/src/js/captions.js index 847ef7ff..28ea266b 100644 --- a/src/js/captions.js +++ b/src/js/captions.js @@ -124,7 +124,8 @@ const captions = { setCue(input) { // Get the track from the event if needed const track = utils.is.event(input) ? input.target : input; - const active = track.activeCues[0]; + const {activeCues} = track; + const active = activeCues.length && activeCues[0]; const currentTrack = captions.getCurrentTrack.call(this); // Only display current track -- cgit v1.2.3 From 6a9be8d16b9fba408f92643471b00f10893032ce Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Tue, 13 Feb 2018 00:01:19 +1100 Subject: Fix for custom controls --- src/js/captions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/js/captions.js') diff --git a/src/js/captions.js b/src/js/captions.js index b1f448de..6ab8c69e 100644 --- a/src/js/captions.js +++ b/src/js/captions.js @@ -39,7 +39,7 @@ const captions = { // Only Vimeo and HTML5 video supported at this point if (!this.isVideo || this.isYouTube || (this.isHTML5 && !support.textTracks)) { // Clear menu and hide - if (this.config.controls.includes('settings') && this.config.settings.includes('captions')) { + if (utils.is.array(this.config.controls) && this.config.controls.includes('settings') && this.config.settings.includes('captions')) { controls.setCaptionsMenu.call(this); } @@ -68,7 +68,7 @@ const captions = { captions.show.call(this); // Set available languages in list - if (this.config.controls.includes('settings') && this.config.settings.includes('captions')) { + if (utils.is.array(this.config.controls) && this.config.controls.includes('settings') && this.config.settings.includes('captions')) { controls.setCaptionsMenu.call(this); } }, @@ -124,7 +124,7 @@ const captions = { setCue(input) { // Get the track from the event if needed const track = utils.is.event(input) ? input.target : input; - const {activeCues} = track; + const { activeCues } = track; const active = activeCues.length && activeCues[0]; const currentTrack = captions.getCurrentTrack.call(this); -- cgit v1.2.3