aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-plugin.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player/peertube-plugin.ts')
-rw-r--r--client/src/assets/player/peertube-plugin.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/client/src/assets/player/peertube-plugin.ts b/client/src/assets/player/peertube-plugin.ts
index a5a706420..a2b038b77 100644
--- a/client/src/assets/player/peertube-plugin.ts
+++ b/client/src/assets/player/peertube-plugin.ts
@@ -233,12 +233,20 @@ class PeerTubePlugin extends Plugin {
233 } 233 }
234 234
235 private alterInactivity () { 235 private alterInactivity () {
236 if (this.menuOpened || this.mouseInControlBar) { 236 if (this.menuOpened) {
237 this.player.options_.inactivityTimeout = this.savedInactivityTimeout 237 this.player.options_.inactivityTimeout = this.savedInactivityTimeout
238 return 238 return
239 } 239 }
240 240
241 this.player.options_.inactivityTimeout = 1 241 if (!this.mouseInControlBar && !this.isTouchEnabled()) {
242 this.player.options_.inactivityTimeout = 1
243 }
244 }
245
246 private isTouchEnabled () {
247 return ('ontouchstart' in window) ||
248 navigator.maxTouchPoints > 0 ||
249 navigator.msMaxTouchPoints > 0
242 } 250 }
243 251
244 private initCaptions () { 252 private initCaptions () {