aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-12 14:35:17 +0200
committerChocobozzz <me@florianbigard.com>2021-07-12 14:35:17 +0200
commit3e9cf56480101af06cdeae9dbae04fdcb4973a7f (patch)
treebf19c79ae273937235a5ee6e38774a372cc0e539
parente89cbbdf9408fd3ea16da540c425ecf2803ac668 (diff)
downloadPeerTube-3e9cf56480101af06cdeae9dbae04fdcb4973a7f.tar.gz
PeerTube-3e9cf56480101af06cdeae9dbae04fdcb4973a7f.tar.zst
PeerTube-3e9cf56480101af06cdeae9dbae04fdcb4973a7f.zip
Fix HTTP fallback with no webtorrent files
-rw-r--r--client/src/assets/player/peertube-player-manager.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts
index 814253188..ba0a6ab80 100644
--- a/client/src/assets/player/peertube-player-manager.ts
+++ b/client/src/assets/player/peertube-player-manager.ts
@@ -388,6 +388,7 @@ export class PeertubePlayerManager {
388 private static addWebTorrentOptions (plugins: VideoJSPluginOptions, options: PeertubePlayerManagerOptions) { 388 private static addWebTorrentOptions (plugins: VideoJSPluginOptions, options: PeertubePlayerManagerOptions) {
389 const commonOptions = options.common 389 const commonOptions = options.common
390 const webtorrentOptions = options.webtorrent 390 const webtorrentOptions = options.webtorrent
391 const p2pMediaLoaderOptions = options.p2pMediaLoader
391 392
392 const autoplay = this.getAutoPlayValue(commonOptions.autoplay) === 'play' 393 const autoplay = this.getAutoPlayValue(commonOptions.autoplay) === 'play'
393 ? true 394 ? true
@@ -397,7 +398,11 @@ export class PeertubePlayerManager {
397 autoplay, 398 autoplay,
398 videoDuration: commonOptions.videoDuration, 399 videoDuration: commonOptions.videoDuration,
399 playerElement: commonOptions.playerElement, 400 playerElement: commonOptions.playerElement,
400 videoFiles: webtorrentOptions.videoFiles, 401 videoFiles: webtorrentOptions.videoFiles.length !== 0
402 ? webtorrentOptions.videoFiles
403 // The WebTorrent plugin won't be able to play these files, but it will fallback to HTTP mode
404 : p2pMediaLoaderOptions.videoFiles,
405 fallbackVideoFiles: p2pMediaLoaderOptions.videoFiles,
401 startTime: commonOptions.startTime 406 startTime: commonOptions.startTime
402 } 407 }
403 408