aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-02-08 14:25:24 +0100
committerChocobozzz <me@florianbigard.com>2022-02-09 11:54:18 +0100
commit15a0e5f3b3b34762be820635434eb11a430ae0c4 (patch)
treec6ab333c888a4aeb301ab255fb6260acd224ff6f /client/src/assets/player
parentcbedb6a5ee60690a98d1d6839bd63f1751433fe8 (diff)
downloadPeerTube-15a0e5f3b3b34762be820635434eb11a430ae0c4.tar.gz
PeerTube-15a0e5f3b3b34762be820635434eb11a430ae0c4.tar.zst
PeerTube-15a0e5f3b3b34762be820635434eb11a430ae0c4.zip
Correctly hide mobile buttons overlay on ios
Diffstat (limited to 'client/src/assets/player')
-rw-r--r--client/src/assets/player/mobile/peertube-mobile-buttons.ts2
-rw-r--r--client/src/assets/player/mobile/peertube-mobile-plugin.ts12
2 files changed, 8 insertions, 6 deletions
diff --git a/client/src/assets/player/mobile/peertube-mobile-buttons.ts b/client/src/assets/player/mobile/peertube-mobile-buttons.ts
index 94eeec023..09cb98f2e 100644
--- a/client/src/assets/player/mobile/peertube-mobile-buttons.ts
+++ b/client/src/assets/player/mobile/peertube-mobile-buttons.ts
@@ -17,7 +17,7 @@ class PeerTubeMobileButtons extends Component {
17 className: 'main-button' 17 className: 'main-button'
18 }) as HTMLDivElement 18 }) as HTMLDivElement
19 19
20 mainButton.addEventListener('click', e => { 20 mainButton.addEventListener('touchstart', e => {
21 e.stopPropagation() 21 e.stopPropagation()
22 22
23 if (this.player_.paused() || this.player_.ended()) { 23 if (this.player_.paused() || this.player_.ended()) {
diff --git a/client/src/assets/player/mobile/peertube-mobile-plugin.ts b/client/src/assets/player/mobile/peertube-mobile-plugin.ts
index a4810d720..91dda7f94 100644
--- a/client/src/assets/player/mobile/peertube-mobile-plugin.ts
+++ b/client/src/assets/player/mobile/peertube-mobile-plugin.ts
@@ -23,7 +23,7 @@ class PeerTubeMobilePlugin extends Plugin {
23 constructor (player: videojs.Player, options: videojs.PlayerOptions) { 23 constructor (player: videojs.Player, options: videojs.PlayerOptions) {
24 super(player, options) 24 super(player, options)
25 25
26 this.peerTubeMobileButtons = player.addChild('PeerTubeMobileButtons') as PeerTubeMobileButtons 26 this.peerTubeMobileButtons = player.addChild('PeerTubeMobileButtons', { reportTouchActivity: false }) as PeerTubeMobileButtons
27 27
28 if (videojs.browser.IS_ANDROID && screen.orientation) { 28 if (videojs.browser.IS_ANDROID && screen.orientation) {
29 this.handleFullscreenRotation() 29 this.handleFullscreenRotation()
@@ -55,8 +55,6 @@ class PeerTubeMobilePlugin extends Plugin {
55 55
56 private initTouchStartEvents () { 56 private initTouchStartEvents () {
57 const handleTouchStart = (event: TouchEvent) => { 57 const handleTouchStart = (event: TouchEvent) => {
58 event.stopPropagation()
59
60 if (this.tapTimeout) { 58 if (this.tapTimeout) {
61 clearTimeout(this.tapTimeout) 59 clearTimeout(this.tapTimeout)
62 this.tapTimeout = undefined 60 this.tapTimeout = undefined
@@ -88,7 +86,12 @@ class PeerTubeMobilePlugin extends Plugin {
88 handleTouchStart(event) 86 handleTouchStart(event)
89 }) 87 })
90 88
91 this.peerTubeMobileButtons.on('touchstart', handleTouchStart) 89 this.peerTubeMobileButtons.el().addEventListener('touchstart', (event: TouchEvent) => {
90 // Prevent mousemove/click events firing on the player, that conflict with our user active logic
91 event.preventDefault()
92
93 handleTouchStart(event)
94 }, { passive: false })
92 } 95 }
93 96
94 private onDoubleTap (event: TouchEvent) { 97 private onDoubleTap (event: TouchEvent) {
@@ -115,7 +118,6 @@ class PeerTubeMobilePlugin extends Plugin {
115 this.peerTubeMobileButtons.displayFastSeek(this.seekAmount) 118 this.peerTubeMobileButtons.displayFastSeek(this.seekAmount)
116 119
117 this.scheduleSetCurrentTime() 120 this.scheduleSetCurrentTime()
118
119 } 121 }
120 122
121 private findPlayerTarget (target: HTMLElement): HTMLElement { 123 private findPlayerTarget (target: HTMLElement): HTMLElement {