Correctly hide mobile buttons overlay on ios
This commit is contained in:
parent
cbedb6a5ee
commit
15a0e5f3b3
|
@ -17,7 +17,7 @@ class PeerTubeMobileButtons extends Component {
|
||||||
className: 'main-button'
|
className: 'main-button'
|
||||||
}) as HTMLDivElement
|
}) as HTMLDivElement
|
||||||
|
|
||||||
mainButton.addEventListener('click', e => {
|
mainButton.addEventListener('touchstart', e => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
|
|
||||||
if (this.player_.paused() || this.player_.ended()) {
|
if (this.player_.paused() || this.player_.ended()) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ class PeerTubeMobilePlugin extends Plugin {
|
||||||
constructor (player: videojs.Player, options: videojs.PlayerOptions) {
|
constructor (player: videojs.Player, options: videojs.PlayerOptions) {
|
||||||
super(player, options)
|
super(player, options)
|
||||||
|
|
||||||
this.peerTubeMobileButtons = player.addChild('PeerTubeMobileButtons') as PeerTubeMobileButtons
|
this.peerTubeMobileButtons = player.addChild('PeerTubeMobileButtons', { reportTouchActivity: false }) as PeerTubeMobileButtons
|
||||||
|
|
||||||
if (videojs.browser.IS_ANDROID && screen.orientation) {
|
if (videojs.browser.IS_ANDROID && screen.orientation) {
|
||||||
this.handleFullscreenRotation()
|
this.handleFullscreenRotation()
|
||||||
|
@ -55,8 +55,6 @@ class PeerTubeMobilePlugin extends Plugin {
|
||||||
|
|
||||||
private initTouchStartEvents () {
|
private initTouchStartEvents () {
|
||||||
const handleTouchStart = (event: TouchEvent) => {
|
const handleTouchStart = (event: TouchEvent) => {
|
||||||
event.stopPropagation()
|
|
||||||
|
|
||||||
if (this.tapTimeout) {
|
if (this.tapTimeout) {
|
||||||
clearTimeout(this.tapTimeout)
|
clearTimeout(this.tapTimeout)
|
||||||
this.tapTimeout = undefined
|
this.tapTimeout = undefined
|
||||||
|
@ -88,7 +86,12 @@ class PeerTubeMobilePlugin extends Plugin {
|
||||||
handleTouchStart(event)
|
handleTouchStart(event)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.peerTubeMobileButtons.on('touchstart', handleTouchStart)
|
this.peerTubeMobileButtons.el().addEventListener('touchstart', (event: TouchEvent) => {
|
||||||
|
// Prevent mousemove/click events firing on the player, that conflict with our user active logic
|
||||||
|
event.preventDefault()
|
||||||
|
|
||||||
|
handleTouchStart(event)
|
||||||
|
}, { passive: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
private onDoubleTap (event: TouchEvent) {
|
private onDoubleTap (event: TouchEvent) {
|
||||||
|
@ -115,7 +118,6 @@ class PeerTubeMobilePlugin extends Plugin {
|
||||||
this.peerTubeMobileButtons.displayFastSeek(this.seekAmount)
|
this.peerTubeMobileButtons.displayFastSeek(this.seekAmount)
|
||||||
|
|
||||||
this.scheduleSetCurrentTime()
|
this.scheduleSetCurrentTime()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private findPlayerTarget (target: HTMLElement): HTMLElement {
|
private findPlayerTarget (target: HTMLElement): HTMLElement {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user