From: Chocobozzz Date: Fri, 4 Feb 2022 08:23:07 +0000 (+0100) Subject: Fix hidding mobile overlay X-Git-Tag: v4.1.0-rc.1~31 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=457c83486ed2037a8cf0e55b06b1ae9370ed4d93;p=github%2FChocobozzz%2FPeerTube.git Fix hidding mobile overlay --- 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) {