1 import { PeertubePlayerManagerOptions } from './manager-options.model'
3 export class WebTorrentOptionsBuilder {
6 private options: PeertubePlayerManagerOptions,
7 private autoPlayValue: any
13 const commonOptions = this.options.common
14 const webtorrentOptions = this.options.webtorrent
15 const p2pMediaLoaderOptions = this.options.p2pMediaLoader
17 const autoplay = this.autoPlayValue === 'play'
22 playerRefusedP2P: commonOptions.p2pEnabled === false,
23 videoDuration: commonOptions.videoDuration,
24 playerElement: commonOptions.playerElement,
26 videoFiles: webtorrentOptions.videoFiles.length !== 0
27 ? webtorrentOptions.videoFiles
28 // The WebTorrent plugin won't be able to play these files, but it will fallback to HTTP mode
29 : p2pMediaLoaderOptions?.videoFiles || [],
31 startTime: commonOptions.startTime