1
0
Fork 0

Don't add mobile buttons without player controls

This commit is contained in:
Chocobozzz 2024-10-07 11:29:26 +02:00
parent 7c3eaf868c
commit e2c7d94915
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -36,12 +36,15 @@ class PeerTubeMobilePlugin extends Plugin {
this.seekAmount = 0 this.seekAmount = 0
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()
} }
// Don't add buttons if the player doesn't have controls
if (!player.controls()) return
this.peerTubeMobileButtons = player.addChild('PeerTubeMobileButtons', { reportTouchActivity: false }) as PeerTubeMobileButtons
if (!this.player.options_.userActions) this.player.options_.userActions = {}; if (!this.player.options_.userActions) this.player.options_.userActions = {};
// FIXME: typings // FIXME: typings