]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix player menu on mobile
authorChocobozzz <me@florianbigard.com>
Thu, 2 Jul 2020 13:10:06 +0000 (15:10 +0200)
committerChocobozzz <me@florianbigard.com>
Thu, 2 Jul 2020 13:10:06 +0000 (15:10 +0200)
client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts
client/src/assets/player/peertube-plugin.ts
client/src/standalone/videos/embed.ts

index 09164a5d3699827f62e2d428af3061dcf8b31e56..286ecac029bdb1465e85b855e5be9d2b809daaba 100644 (file)
@@ -39,8 +39,6 @@ export class RemoteSubscribeComponent extends FormReactive implements OnInit {
     fetch(`https://${hostname}/.well-known/webfinger?resource=acct:${username}@${hostname}`)
       .then(response => response.json())
       .then(data => new Promise((resolve, reject) => {
-        console.log(data)
-
         if (data && Array.isArray(data.links)) {
           const link: { template: string } = data.links.find((link: any) => {
             return link && typeof link.template === 'string' && link.rel === 'http://ostatus.org/schema/1.0/subscribe'
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 () {
index 286757e5e0022bb9958017a547d520ef16987bbf..86a91643ae7aa191b39237c20311dcbb8bde8c55 100644 (file)
@@ -201,7 +201,7 @@ export class PeerTubeEmbed {
         subtitle: this.subtitle,
 
         videoCaptions,
-        inactivityTimeout: 1500,
+        inactivityTimeout: 2500,
         videoViewUrl: this.getVideoUrl(videoId) + '/views',
 
         playerElement: this.videoElement,