Relax webtorrent file check

pull/3421/head
Chocobozzz 2020-12-07 16:53:11 +01:00
parent 77002f5291
commit 6a882bc400
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 3 additions and 3 deletions

View File

@ -132,14 +132,14 @@ class WebTorrentPlugin extends Plugin {
done: () => void = () => { /* empty */ } done: () => void = () => { /* empty */ }
) { ) {
// Automatically choose the adapted video file // Automatically choose the adapted video file
if (videoFile === undefined) { if (!videoFile) {
const savedAverageBandwidth = getAverageBandwidthInStore() const savedAverageBandwidth = getAverageBandwidthInStore()
videoFile = savedAverageBandwidth videoFile = savedAverageBandwidth
? this.getAppropriateFile(savedAverageBandwidth) ? this.getAppropriateFile(savedAverageBandwidth)
: this.pickAverageVideoFile() : this.pickAverageVideoFile()
} }
if (!!videoFile) { if (!videoFile) {
throw Error(`Can't update video file since videoFile is undefined.`) 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 // 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 // Hack to "simulate" src link in video.js >= 6
// Without this, we can't play the video after pausing it // Without this, we can't play the video after pausing it