From 457c83486ed2037a8cf0e55b06b1ae9370ed4d93 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 4 Feb 2022 09:23:07 +0100 Subject: Fix hidding mobile overlay --- client/src/assets/player/mobile/peertube-mobile-plugin.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/client/src/assets/player/mobile/peertube-mobile-plugin.ts b/client/src/assets/player/mobile/peertube-mobile-plugin.ts index 95864c817..a4810d720 100644 --- a/client/src/assets/player/mobile/peertube-mobile-plugin.ts +++ b/client/src/assets/player/mobile/peertube-mobile-plugin.ts @@ -54,7 +54,7 @@ class PeerTubeMobilePlugin extends Plugin { } private initTouchStartEvents () { - this.player.on('touchstart', (event: TouchEvent) => { + const handleTouchStart = (event: TouchEvent) => { event.stopPropagation() if (this.tapTimeout) { @@ -79,7 +79,16 @@ class PeerTubeMobilePlugin extends Plugin { }, PeerTubeMobilePlugin.DOUBLE_TAP_DELAY_MS) this.lastTapEvent = event + } + + this.player.on('touchstart', (event: TouchEvent) => { + // Only enable user active on player touch, we listen event on peertube mobile buttons to disable it + if (this.player.userActive()) return + + handleTouchStart(event) }) + + this.peerTubeMobileButtons.on('touchstart', handleTouchStart) } private onDoubleTap (event: TouchEvent) { -- cgit v1.2.3