diff options
author | Sam Potts <sam@potts.es> | 2018-10-24 22:31:47 +1100 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-10-24 22:31:47 +1100 |
commit | 5d5a6eabaafe4637ffdb2e7b605bd0dff79d3a38 (patch) | |
tree | c8955edd5f3b0d5d207ee06623afdc4fb7039c87 /src/js/ui.js | |
parent | 03c9b53232aeab78a7c592e1bcf387312f77a569 (diff) | |
parent | 7559cc68977d109c0a2f7dd14301af2fb31e97e0 (diff) | |
download | plyr-5d5a6eabaafe4637ffdb2e7b605bd0dff79d3a38.tar.lz plyr-5d5a6eabaafe4637ffdb2e7b605bd0dff79d3a38.tar.xz plyr-5d5a6eabaafe4637ffdb2e7b605bd0dff79d3a38.zip |
Merge branch 'develop' of github.com:sampotts/plyr into develop
Diffstat (limited to 'src/js/ui.js')
-rw-r--r-- | src/js/ui.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/js/ui.js b/src/js/ui.js index f0c898bf..8e50bb83 100644 --- a/src/js/ui.js +++ b/src/js/ui.js @@ -247,8 +247,11 @@ const ui = { const { controls } = this.elements; if (controls && this.config.hideControls) { - // Show controls if force, loading, paused, or button interaction, otherwise hide - this.toggleControls(Boolean(force || this.loading || this.paused || controls.pressed || controls.hover)); + // Don't hide controls if a touch-device user recently seeked. (Must be limited to touch devices, or it occasionally prevents desktop controls from hiding.) + const recentTouchSeek = (this.touch && this.lastSeekTime + 2000 > Date.now()); + + // Show controls if force, loading, paused, button interaction, or recent seek, otherwise hide + this.toggleControls(Boolean(force || this.loading || this.paused || controls.pressed || controls.hover || recentTouchSeek)); } }, }; |