From 7aad747c25b07fedf4a4fc75095c560ea3c9899c Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Sun, 27 May 2018 05:08:18 +0200 Subject: Optimize captions code reused and ensure captionsenabled/captionsdisabled will be sent on initial setup --- src/js/ui.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/js/ui.js') diff --git a/src/js/ui.js b/src/js/ui.js index 3a8f2d05..0d8e532f 100644 --- a/src/js/ui.js +++ b/src/js/ui.js @@ -55,8 +55,10 @@ const ui = { // Remove native controls ui.toggleNativeControls.call(this); - // Captions - captions.setup.call(this); + // Setup captions for html5 + if (this.isHTML5) { + captions.setup.call(this); + } // Reset volume this.volume = null; -- cgit v1.2.3 From c9298fde768d14975a41ce8018fd0f10116943aa Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Sun, 13 May 2018 19:58:23 +0200 Subject: Fix typo --- src/js/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/js/ui.js') diff --git a/src/js/ui.js b/src/js/ui.js index 0d8e532f..9a6692dc 100644 --- a/src/js/ui.js +++ b/src/js/ui.js @@ -55,7 +55,7 @@ const ui = { // Remove native controls ui.toggleNativeControls.call(this); - // Setup captions for html5 + // Setup captions for HTML5 if (this.isHTML5) { captions.setup.call(this); } -- cgit v1.2.3 From 9d798893b56e2ebe9da2d6b87f639f2d2ecee365 Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Tue, 29 May 2018 16:06:07 +0200 Subject: Call duration update method manually if user config has duration --- src/js/ui.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/js/ui.js') diff --git a/src/js/ui.js b/src/js/ui.js index 3a8f2d05..aa398e3a 100644 --- a/src/js/ui.js +++ b/src/js/ui.js @@ -109,6 +109,12 @@ const ui = { if (this.poster && this.elements.poster && !this.elements.poster.style.backgroundImage) { ui.setPoster.call(this, this.poster); } + + // Manually set the duration if user has overridden it. + // The event listeners for it doesn't get called if preload is disabled (#701) + if (this.config.duration) { + controls.durationUpdate.call(this); + } }, // Setup aria attribute for play and iframe title -- cgit v1.2.3