From aa8fc313a91ec38b6c430c9b88eec7944948c521 Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Sat, 12 May 2018 11:24:50 +0200 Subject: Fix #966: Add 'seeked' event listener to update progress (seeking doesn't have the correct time) --- src/js/controls.js | 1 + 1 file changed, 1 insertion(+) (limited to 'src/js/controls.js') diff --git a/src/js/controls.js b/src/js/controls.js index 3f720925..61fb2039 100644 --- a/src/js/controls.js +++ b/src/js/controls.js @@ -481,6 +481,7 @@ const controls = { // Video playing case 'timeupdate': case 'seeking': + case 'seeked': value = utils.getPercentage(this.currentTime, this.duration); // Set seek range value only if it's a 'natural' time event -- cgit v1.2.3 From 121093ae7113cbd74d4202332a88d184c0049320 Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Sat, 12 May 2018 11:54:28 +0200 Subject: Prevent durationchange events from showing time when invertTime is false --- src/js/controls.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/js/controls.js') diff --git a/src/js/controls.js b/src/js/controls.js index 61fb2039..d266ed6b 100644 --- a/src/js/controls.js +++ b/src/js/controls.js @@ -602,9 +602,10 @@ const controls = { controls.updateProgress.call(this, event); }, - // Show the duration on metadataloaded + // Show the duration on metadataloaded or durationchange events durationUpdate() { - if (!this.supported.ui) { + // Bail if no ui or durationchange event triggered after playing/seek when invertTime is false + if (!this.supported.ui || (!this.config.invertTime && this.currentTime)) { return; } -- cgit v1.2.3