From 6f77778a7097b9e65dc2a3f0611f95187a3d2023 Mon Sep 17 00:00:00 2001 From: Grzegorz Blaszczyk Date: Wed, 15 Jan 2020 18:11:03 +0100 Subject: [PATCH] fix: improves control bar hiding functionality (#6400) Fixes #6391 --- src/js/player.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/player.js b/src/js/player.js index 2cf0eb2119..520ca1cc36 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -3860,7 +3860,7 @@ class Player extends Component { mouseInProgress = this.setInterval(handleActivity, 250); }; - const handleMouseUp = function(event) { + const handleMouseUpAndMouseLeave = function(event) { handleActivity(); // Stop the interval that maintains activity if the mouse/touch is down this.clearInterval(mouseInProgress); @@ -3869,7 +3869,8 @@ class Player extends Component { // Any mouse movement will be considered user activity this.on('mousedown', handleMouseDown); this.on('mousemove', handleMouseMove); - this.on('mouseup', handleMouseUp); + this.on('mouseup', handleMouseUpAndMouseLeave); + this.on('mouseleave', handleMouseUpAndMouseLeave); const controlBar = this.getChild('controlBar');