Skip to content

Commit

Permalink
Fixed issue where ManualTimeUpdatesOff was not de-registering events. c…
Browse files Browse the repository at this point in the history
…loses videojs#1793
  • Loading branch information
gkatsev authored and mmcc committed Jan 16, 2015
1 parent a8d1ef1 commit 1c17a67
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CHANGELOG
* @Sxmanek added a Czech translation ([view](/~https://github.com/videojs/video.js/pull/1739))
* @jcaron23 added the vjs-scrubbing CSS class and prevented menus from showing while scrubbing ([view](/~https://github.com/videojs/video.js/pull/1741))
* @dmlap fixed URL parsing in IE9 ([view](/~https://github.com/videojs/video.js/pull/1765))
* Fixed issue where ManualTimeUpdatesOff was not de-registering events ([view](/~https://github.com/videojs/video.js/pull/1793))

--------------------

Expand Down
6 changes: 4 additions & 2 deletions src/js/media/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down
1 change: 1 addition & 0 deletions test/unit/flash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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_: {}
}, {
Expand Down
1 change: 1 addition & 0 deletions test/unit/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1c17a67

Please sign in to comment.