Skip to content

Commit

Permalink
Close GH-899: Fix firefox+flash mousemove bubbling. Fixes #37
Browse files Browse the repository at this point in the history
  • Loading branch information
heff committed Dec 20, 2013
1 parent 950072a commit 0f38d27
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/js/media/flash.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ vjs.Flash = vjs.MediaTechController.extend({
});
}

// firefox doesn't bubble mousemove events to parent. videojs/video-js-swf#37
// bugzilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=836786
if (vjs.IS_FIREFOX) {
this.ready(function(){
vjs.on(this.el(), 'mousemove', vjs.bind(this, function(){
// since it's a custom event, don't bubble higher than the player
this.player().trigger({ 'type':'mousemove', 'bubbles': false });
}));
});
}

// Flash iFrame Mode
// In web browsers there are multiple instances where changing the parent element or visibility of a plugin causes the plugin to reload.
// - Firefox just about always. https://bugzilla.mozilla.org/show_bug.cgi?id=90268 (might be fixed by version 13)
Expand Down
2 changes: 1 addition & 1 deletion src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ vjs.Player.prototype.listenForUserActivity = function(){
// Setting userActivity=true now and setting the interval to the same time
// as the activityCheck interval (250) should ensure we never miss the
// next activityCheck
mouseInProgress = setInterval(this, onMouseActivity, 250);
mouseInProgress = setInterval(onMouseActivity, 250);
};

onMouseUp = function(event) {
Expand Down

0 comments on commit 0f38d27

Please sign in to comment.