diff options
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/assets/player/mobile/peertube-mobile-buttons.ts | 2 | ||||
-rw-r--r-- | client/src/assets/player/mobile/peertube-mobile-plugin.ts | 12 |
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 { |