aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-plugin.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-01-11 11:26:35 +0100
committerChocobozzz <me@florianbigard.com>2022-01-11 11:26:35 +0100
commitf1a0555a88db9ade2b073a2e4dc73c4a6176c8a0 (patch)
treee1f73376527152fb9ac92447a826bccc9e8f0dd5 /client/src/assets/player/peertube-plugin.ts
parentba9eef5f628764aed6183135e669b17741d24d7a (diff)
downloadPeerTube-f1a0555a88db9ade2b073a2e4dc73c4a6176c8a0.tar.gz
PeerTube-f1a0555a88db9ade2b073a2e4dc73c4a6176c8a0.tar.zst
PeerTube-f1a0555a88db9ade2b073a2e4dc73c4a6176c8a0.zip
Add player controls on mobile
Diffstat (limited to 'client/src/assets/player/peertube-plugin.ts')
-rw-r--r--client/src/assets/player/peertube-plugin.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/client/src/assets/player/peertube-plugin.ts b/client/src/assets/player/peertube-plugin.ts
index 451b4a161..272f5353d 100644
--- a/client/src/assets/player/peertube-plugin.ts
+++ b/client/src/assets/player/peertube-plugin.ts
@@ -12,6 +12,9 @@ import {
12import { PeerTubePluginOptions, UserWatching, VideoJSCaption } from './peertube-videojs-typings' 12import { PeerTubePluginOptions, UserWatching, VideoJSCaption } from './peertube-videojs-typings'
13import { isMobile } from './utils' 13import { isMobile } from './utils'
14import { SettingsButton } from './videojs-components/settings-menu-button' 14import { SettingsButton } from './videojs-components/settings-menu-button'
15import debug from 'debug'
16
17const logger = debug('peertube:player:peertube')
15 18
16const Plugin = videojs.getPlugin('plugin') 19const Plugin = videojs.getPlugin('plugin')
17 20
@@ -233,7 +236,7 @@ class PeerTubePlugin extends Plugin {
233 } 236 }
234 237
235 private alterInactivity () { 238 private alterInactivity () {
236 if (this.menuOpened || this.mouseInSettings || this.mouseInControlBar || this.isTouchEnabled()) { 239 if (this.menuOpened || this.mouseInSettings || this.mouseInControlBar) {
237 this.setInactivityTimeout(0) 240 this.setInactivityTimeout(0)
238 return 241 return
239 } 242 }
@@ -245,6 +248,8 @@ class PeerTubePlugin extends Plugin {
245 private setInactivityTimeout (timeout: number) { 248 private setInactivityTimeout (timeout: number) {
246 (this.player as any).cache_.inactivityTimeout = timeout 249 (this.player as any).cache_.inactivityTimeout = timeout
247 this.player.options_.inactivityTimeout = timeout 250 this.player.options_.inactivityTimeout = timeout
251
252 logger('Set player inactivity to ' + timeout)
248 } 253 }
249 254
250 private isTouchEnabled () { 255 private isTouchEnabled () {