Fix webtorrent resolution issue
authorChocobozzz <me@florianbigard.com>
Wed, 29 Jan 2020 13:20:32 +0000 (14:20 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 29 Jan 2020 13:20:32 +0000 (14:20 +0100)
client/src/assets/player/peertube-videojs-typings.ts
client/src/assets/player/webtorrent/webtorrent-plugin.ts

index 7b0ea20748e36ee10c61d205bb9e1940ed14d442..e4572266130c8bd03c3686f563ad15b6cc9c5344 100644 (file)
@@ -30,11 +30,12 @@ declare module 'video.js' {
 
     qualityLevels (): { height: number, id: number }[] & {
       selectedIndex: number
+      selectedIndex_: number
 
       addQualityLevel (representation: {
         id: number
         label: string
-        height: number,
+        height: number
         _enabled: boolean
       }): void
     }
index 3d335acbc0adfb500440c5f288b8ffc1c778a85b..d26fc38faa09328e522635c17f040222653c08fa 100644 (file)
@@ -650,8 +650,8 @@ class WebTorrentPlugin extends Plugin {
     }
 
     for (let i = 0; i < qualityLevels.length; i++) {
-      const q = this.player.qualityLevels[i]
-      if (q.height === resolutionId) qualityLevels.selectedIndex = i
+      const q = qualityLevels[i]
+      if (q.height === resolutionId) qualityLevels.selectedIndex_ = i
     }
   }
 }