Skip to content

Commit

Permalink
fix(player): add mouse event handlers ('mouseenter' and 'mouseleave)
Browse files Browse the repository at this point in the history
Handles the 'mouseenter' and 'mouseleave' events when triggered in the control-bar
Closes videojs#5258
  • Loading branch information
xjoaoalvesx committed Dec 17, 2018
1 parent bc7d530 commit ab8fa2d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -3444,6 +3444,16 @@ class Player extends Component {
this.on('mousemove', handleMouseMove);
this.on('mouseup', handleMouseUp);

this.on(this.getChild('controlBar'), 'mouseenter', function(event) {
this.options_.inactivityTimeout = 0;

});

this.on(this.getChild('controlBar'), 'mouseleave', function(event) {
this.options_.inactivityTimeout = 2000;

});

// Listen for keyboard navigation
// Shouldn't need to use inProgress interval because of key repeat
this.on('keydown', handleActivity);
Expand Down

0 comments on commit ab8fa2d

Please sign in to comment.