From cf57794e9b104401884998c38b2dfa7cfe9638b0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 29 Jan 2020 14:20:32 +0100 Subject: Fix webtorrent resolution issue --- client/src/assets/player/peertube-videojs-typings.ts | 3 ++- client/src/assets/player/webtorrent/webtorrent-plugin.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'client') diff --git a/client/src/assets/player/peertube-videojs-typings.ts b/client/src/assets/player/peertube-videojs-typings.ts index 7b0ea2074..e45722661 100644 --- a/client/src/assets/player/peertube-videojs-typings.ts +++ b/client/src/assets/player/peertube-videojs-typings.ts @@ -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 } diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/webtorrent/webtorrent-plugin.ts index 3d335acbc..d26fc38fa 100644 --- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts +++ b/client/src/assets/player/webtorrent/webtorrent-plugin.ts @@ -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 } } } -- cgit v1.2.3