Skip to content

Commit 4c079a6

Browse files
committed
disable autohide controller when paused
1 parent 743b3d0 commit 4c079a6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/js/controller.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ class Controller {
1313
this.player.container.addEventListener('click', () => {
1414
this.setAutoHide();
1515
});
16+
this.player.on('play', () => {
17+
this.setAutoHide();
18+
});
19+
this.player.on('pause', () => {
20+
this.setAutoHide();
21+
});
1622
}
1723

1824
this.initPlayButton();
@@ -217,7 +223,7 @@ class Controller {
217223
this.show();
218224
clearTimeout(this.autoHideTimer);
219225
this.autoHideTimer = setTimeout(() => {
220-
if (this.player.video.played.length && !this.disableAutoHide) {
226+
if (this.player.video.played.length && !this.player.paused && !this.disableAutoHide) {
221227
this.hide();
222228
}
223229
}, 3000);

0 commit comments

Comments
 (0)