aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/webtorrent/webtorrent-plugin.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-15 15:58:10 +0100
committerChocobozzz <me@florianbigard.com>2021-12-16 10:08:55 +0100
commita9bfa85d2cdf13670aaced740da5b493fbeddfce (patch)
tree3781c9218d4cc7786b6589365c0efbed2151703d /client/src/assets/player/webtorrent/webtorrent-plugin.ts
parentc77fdc605b3ccc1ab6890f889d8200fbe9372949 (diff)
downloadPeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.tar.gz
PeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.tar.zst
PeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.zip
Add ability for admins to set default p2p policy
Diffstat (limited to 'client/src/assets/player/webtorrent/webtorrent-plugin.ts')
-rw-r--r--client/src/assets/player/webtorrent/webtorrent-plugin.ts13
1 files changed, 4 insertions, 9 deletions
diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/webtorrent/webtorrent-plugin.ts
index 1a1cd7f1a..2b9390206 100644
--- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts
+++ b/client/src/assets/player/webtorrent/webtorrent-plugin.ts
@@ -2,13 +2,7 @@ import videojs from 'video.js'
2import * as WebTorrent from 'webtorrent' 2import * as WebTorrent from 'webtorrent'
3import { timeToInt } from '@shared/core-utils' 3import { timeToInt } from '@shared/core-utils'
4import { VideoFile } from '@shared/models' 4import { VideoFile } from '@shared/models'
5import { 5import { getAverageBandwidthInStore, getStoredMute, getStoredVolume, saveAverageBandwidth } from '../peertube-player-local-storage'
6 getAverageBandwidthInStore,
7 getStoredMute,
8 getStoredP2PEnabled,
9 getStoredVolume,
10 saveAverageBandwidth
11} from '../peertube-player-local-storage'
12import { PeerTubeResolution, PlayerNetworkInfo, WebtorrentPluginOptions } from '../peertube-videojs-typings' 6import { PeerTubeResolution, PlayerNetworkInfo, WebtorrentPluginOptions } from '../peertube-videojs-typings'
13import { getRtcConfig, isIOS, videoFileMaxByResolution, videoFileMinByResolution } from '../utils' 7import { getRtcConfig, isIOS, videoFileMaxByResolution, videoFileMinByResolution } from '../utils'
14import { PeertubeChunkStore } from './peertube-chunk-store' 8import { PeertubeChunkStore } from './peertube-chunk-store'
@@ -74,9 +68,10 @@ class WebTorrentPlugin extends Plugin {
74 68
75 this.startTime = timeToInt(options.startTime) 69 this.startTime = timeToInt(options.startTime)
76 70
77 // Disable auto play on iOS 71 // Custom autoplay handled by webtorrent because we lazy play the video
78 this.autoplay = options.autoplay 72 this.autoplay = options.autoplay
79 this.playerRefusedP2P = !getStoredP2PEnabled() 73
74 this.playerRefusedP2P = options.playerRefusedP2P
80 75
81 this.videoFiles = options.videoFiles 76 this.videoFiles = options.videoFiles
82 this.videoDuration = options.videoDuration 77 this.videoDuration = options.videoDuration