From 5e4a7cd015b556c101023adcc71719266463690d Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Fri, 9 Jan 2015 17:20:44 -0500 Subject: [PATCH 1/2] ManualTimeUpdatesOff was not de-registering events ManualTimeUpdatesOff was trying to de-register trackCurrentTime and stopTrackingCurrentTime against itself rather than the player, which is where these events were registered against. --- src/js/media/media.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/media/media.js b/src/js/media/media.js index e75a8dbcda..80f4c18de2 100644 --- a/src/js/media/media.js +++ b/src/js/media/media.js @@ -215,10 +215,12 @@ vjs.MediaTechController.prototype.manualTimeUpdatesOn = function(){ }; vjs.MediaTechController.prototype.manualTimeUpdatesOff = function(){ + var player = this.player_; + this.manualTimeUpdates = false; this.stopTrackingCurrentTime(); - this.off('play', this.trackCurrentTime); - this.off('pause', this.stopTrackingCurrentTime); + this.off(player, 'play', this.trackCurrentTime); + this.off(player, 'pause', this.stopTrackingCurrentTime); }; vjs.MediaTechController.prototype.trackCurrentTime = function(){ From 9bc6445f95054ef61460a31ce9b7751484c395af Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Fri, 9 Jan 2015 17:34:30 -0500 Subject: [PATCH 2/2] fixup tests --- test/unit/flash.js | 1 + test/unit/media.js | 1 + 2 files changed, 2 insertions(+) diff --git a/test/unit/flash.js b/test/unit/flash.js index 24f5ea3e5d..9cd14a5b9b 100644 --- a/test/unit/flash.js +++ b/test/unit/flash.js @@ -105,6 +105,7 @@ test('dispose removes the object element even before ready fires', function() { tech = new vjs.Flash({ id: noop, on: noop, + off: noop, trigger: noop, options_: {} }, { diff --git a/test/unit/media.js b/test/unit/media.js index f217b22d79..04a7f20dc1 100644 --- a/test/unit/media.js +++ b/test/unit/media.js @@ -39,6 +39,7 @@ test('stops timeupdates if the tech produces them natively', function() { var timeupdates = 0, tech, playHandler, expected; tech = new videojs.MediaTechController({ id: this.noop, + off: this.noop, on: function(event, handler) { if (event === 'play') { playHandler = handler;