diff options
author | Sam Potts <sam@potts.es> | 2018-10-24 22:39:10 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-24 22:39:10 +1100 |
commit | b6175b1ca903640cb44f62e29cc10d77fc3655be (patch) | |
tree | 6ce4fec55e18f09024f210f6a4c8cc1418b6aa11 /src/js/ui.js | |
parent | a86bbae85145a22d0ed7f259fe86fe82b86dd7ff (diff) | |
parent | aa20ebaa9c38363c0d1720bbb6c3c37eef630393 (diff) | |
download | plyr-b6175b1ca903640cb44f62e29cc10d77fc3655be.tar.lz plyr-b6175b1ca903640cb44f62e29cc10d77fc3655be.tar.xz plyr-b6175b1ca903640cb44f62e29cc10d77fc3655be.zip |
Merge branch 'develop' into fix-html5-quality-settings
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)); } }, }; |