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
1 changed files with 5 additions and 2 deletions

View File

@ -36,12 +36,15 @@ class PeerTubeMobilePlugin extends Plugin {
this.seekAmount = 0
this.peerTubeMobileButtons = player.addChild('PeerTubeMobileButtons', { reportTouchActivity: false }) as PeerTubeMobileButtons
if (videojs.browser.IS_ANDROID && screen.orientation) {
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 = {};
// FIXME: typings