From e2bfe09c7b927de5adbaf222c4bab4e9d4f0ab96 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Mon, 18 Jul 2016 14:29:26 -0400 Subject: [PATCH] @MattiasBuelens updated components to use durationchange only. closes #3349 --- CHANGELOG.md | 1 + src/js/control-bar/time-controls/duration-display.js | 8 +------- .../control-bar/time-controls/remaining-time-display.js | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42f4f8af47..c71a940dad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ CHANGELOG * @nickygerritsen removed unused tracks when changing sources. Fixes #3000 ([view](https://github.com/videojs/video.js/pull/3002)) * @vit-koumar updated Flash tech to return Infinity from duration instead of -1 ([view](https://github.com/videojs/video.js/pull/3128)) * @alex-phillips added ontextdata to Flash tech ([view](https://github.com/videojs/video.js/pull/2748)) +* @MattiasBuelens updated components to use durationchange only ([view](https://github.com/videojs/video.js/pull/3349)) -------------------- diff --git a/src/js/control-bar/time-controls/duration-display.js b/src/js/control-bar/time-controls/duration-display.js index 4350c2e1e1..0496e3cd50 100644 --- a/src/js/control-bar/time-controls/duration-display.js +++ b/src/js/control-bar/time-controls/duration-display.js @@ -18,13 +18,7 @@ class DurationDisplay extends Component { constructor(player, options){ super(player, options); - // this might need to be changed to 'durationchange' instead of 'timeupdate' eventually, - // however the durationchange event fires before this.player_.duration() is set, - // so the value cannot be written out using this method. - // Once the order of durationchange and this.player_.duration() being set is figured out, - // this can be updated. - this.on(player, 'timeupdate', this.updateContent); - this.on(player, 'loadedmetadata', this.updateContent); + this.on(player, 'durationchange', this.updateContent); } /** diff --git a/src/js/control-bar/time-controls/remaining-time-display.js b/src/js/control-bar/time-controls/remaining-time-display.js index 13ed25a1f4..8ac701f6b1 100644 --- a/src/js/control-bar/time-controls/remaining-time-display.js +++ b/src/js/control-bar/time-controls/remaining-time-display.js @@ -19,6 +19,7 @@ class RemainingTimeDisplay extends Component { super(player, options); this.on(player, 'timeupdate', this.updateContent); + this.on(player, 'durationchange', this.updateContent); } /**