diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-15 15:58:10 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-16 10:08:55 +0100 |
commit | a9bfa85d2cdf13670aaced740da5b493fbeddfce (patch) | |
tree | 3781c9218d4cc7786b6589365c0efbed2151703d /client/src/assets/player/webtorrent | |
parent | c77fdc605b3ccc1ab6890f889d8200fbe9372949 (diff) | |
download | PeerTube-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')
-rw-r--r-- | client/src/assets/player/webtorrent/webtorrent-plugin.ts | 13 |
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' | |||
2 | import * as WebTorrent from 'webtorrent' | 2 | import * as WebTorrent from 'webtorrent' |
3 | import { timeToInt } from '@shared/core-utils' | 3 | import { timeToInt } from '@shared/core-utils' |
4 | import { VideoFile } from '@shared/models' | 4 | import { VideoFile } from '@shared/models' |
5 | import { | 5 | import { 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' | ||
12 | import { PeerTubeResolution, PlayerNetworkInfo, WebtorrentPluginOptions } from '../peertube-videojs-typings' | 6 | import { PeerTubeResolution, PlayerNetworkInfo, WebtorrentPluginOptions } from '../peertube-videojs-typings' |
13 | import { getRtcConfig, isIOS, videoFileMaxByResolution, videoFileMinByResolution } from '../utils' | 7 | import { getRtcConfig, isIOS, videoFileMaxByResolution, videoFileMinByResolution } from '../utils' |
14 | import { PeertubeChunkStore } from './peertube-chunk-store' | 8 | import { 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 |