Fix hidding mobile overlay

pull/4795/head
Chocobozzz 2022-02-04 09:23:07 +01:00
parent 6e0ee5a53a
commit 457c83486e
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 10 additions and 1 deletions

View File

@ -54,7 +54,7 @@ class PeerTubeMobilePlugin extends Plugin {
} }
private initTouchStartEvents () { private initTouchStartEvents () {
this.player.on('touchstart', (event: TouchEvent) => { const handleTouchStart = (event: TouchEvent) => {
event.stopPropagation() event.stopPropagation()
if (this.tapTimeout) { if (this.tapTimeout) {
@ -79,7 +79,16 @@ class PeerTubeMobilePlugin extends Plugin {
}, PeerTubeMobilePlugin.DOUBLE_TAP_DELAY_MS) }, PeerTubeMobilePlugin.DOUBLE_TAP_DELAY_MS)
this.lastTapEvent = event 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) { private onDoubleTap (event: TouchEvent) {