From 6a882bc400d5b5960eb5a29cd72c9a5e0a69a64f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 7 Dec 2020 16:53:11 +0100 Subject: Relax webtorrent file check --- client/src/assets/player/webtorrent/webtorrent-plugin.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'client/src/assets') diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/webtorrent/webtorrent-plugin.ts index 9beb04d10..c36362408 100644 --- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts +++ b/client/src/assets/player/webtorrent/webtorrent-plugin.ts @@ -132,14 +132,14 @@ class WebTorrentPlugin extends Plugin { done: () => void = () => { /* empty */ } ) { // Automatically choose the adapted video file - if (videoFile === undefined) { + if (!videoFile) { const savedAverageBandwidth = getAverageBandwidthInStore() videoFile = savedAverageBandwidth ? this.getAppropriateFile(savedAverageBandwidth) : this.pickAverageVideoFile() } - if (!!videoFile) { + if (!videoFile) { throw Error(`Can't update video file since videoFile is undefined.`) } @@ -149,7 +149,7 @@ class WebTorrentPlugin extends Plugin { } // Do not display error to user because we will have multiple fallback - this.disableErrorDisplay(); + this.disableErrorDisplay() // Hack to "simulate" src link in video.js >= 6 // Without this, we can't play the video after pausing it -- cgit v1.2.3