Skip to content

Commit

Permalink
disable autohide controller when paused
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jan 19, 2018
1 parent 743b3d0 commit 4c079a6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/js/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ class Controller {
this.player.container.addEventListener('click', () => {
this.setAutoHide();
});
this.player.on('play', () => {
this.setAutoHide();
});
this.player.on('pause', () => {
this.setAutoHide();
});
}

this.initPlayButton();
Expand Down Expand Up @@ -217,7 +223,7 @@ class Controller {
this.show();
clearTimeout(this.autoHideTimer);
this.autoHideTimer = setTimeout(() => {
if (this.player.video.played.length && !this.disableAutoHide) {
if (this.player.video.played.length && !this.player.paused && !this.disableAutoHide) {
this.hide();
}
}, 3000);
Expand Down

0 comments on commit 4c079a6

Please sign in to comment.