From 9d798893b56e2ebe9da2d6b87f639f2d2ecee365 Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Tue, 29 May 2018 16:06:07 +0200 Subject: [PATCH] Call duration update method manually if user config has duration --- src/js/ui.js | 6 ++++++ 1 file changed, 6 insertions(+) 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