]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/peertube-plugin.ts
Add playlist embed E2E test
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / peertube-plugin.ts
index a5a706420c6b146ac17aa66140e794e441f37de1..a2b038b775693792813505ee6fb8e73c13a456be 100644 (file)
@@ -233,12 +233,20 @@ class PeerTubePlugin extends Plugin {
   }
 
   private alterInactivity () {
-    if (this.menuOpened || this.mouseInControlBar) {
+    if (this.menuOpened) {
       this.player.options_.inactivityTimeout = this.savedInactivityTimeout
       return
     }
 
-    this.player.options_.inactivityTimeout = 1
+    if (!this.mouseInControlBar && !this.isTouchEnabled()) {
+      this.player.options_.inactivityTimeout = 1
+    }
+  }
+
+  private isTouchEnabled () {
+    return ('ontouchstart' in window) ||
+      navigator.maxTouchPoints > 0 ||
+      navigator.msMaxTouchPoints > 0
   }
 
   private initCaptions () {