From 4c079a64c20b6e58c91aa3ce45235e23e7a89f2d Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 19 Jan 2018 14:48:21 +0800 Subject: [PATCH] disable autohide controller when paused --- src/js/controller.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/js/controller.js b/src/js/controller.js index 5f32eca..6be5f1f 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -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(); @@ -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);