Merge pull request #1977 from trafium/prevent-mobile-control-hiding-on-rewind-and-fast-forward

Prevent immediate hiding of controls on mobile when using rewind and fast forward
This commit is contained in:
Sam Potts 2020-10-19 22:34:30 +11:00 committed by GitHub
commit 92f3728d80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -569,10 +569,18 @@ class Listeners {
this.bind(elements.buttons.restart, 'click', player.restart, 'restart'); this.bind(elements.buttons.restart, 'click', player.restart, 'restart');
// Rewind // Rewind
this.bind(elements.buttons.rewind, 'click', player.rewind, 'rewind'); this.bind(elements.buttons.rewind, 'click', () => {
// Record seek time so we can prevent hiding controls for a few seconds after rewind
player.lastSeekTime = Date.now();
player.rewind();
}, 'rewind');
// Rewind // Rewind
this.bind(elements.buttons.fastForward, 'click', player.forward, 'fastForward'); this.bind(elements.buttons.fastForward, 'click', () => {
// Record seek time so we can prevent hiding controls for a few seconds after fast forward
player.lastSeekTime = Date.now();
player.forward();
}, 'fastForward');
// Mute toggle // Mute toggle
this.bind( this.bind(