diff options
Diffstat (limited to 'client/src/assets/player/peertube-videojs-plugin.ts')
-rw-r--r-- | client/src/assets/player/peertube-videojs-plugin.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts index 90ca8f9fa..a53a2cc69 100644 --- a/client/src/assets/player/peertube-videojs-plugin.ts +++ b/client/src/assets/player/peertube-videojs-plugin.ts | |||
@@ -8,7 +8,7 @@ import { isMobile, timeToInt, videoFileMaxByResolution, videoFileMinByResolution | |||
8 | import * as CacheChunkStore from 'cache-chunk-store' | 8 | import * as CacheChunkStore from 'cache-chunk-store' |
9 | import { PeertubeChunkStore } from './peertube-chunk-store' | 9 | import { PeertubeChunkStore } from './peertube-chunk-store' |
10 | import { | 10 | import { |
11 | getStoredWebTorrentPolicy, | 11 | getStoredWebTorrentEnabled, |
12 | getAverageBandwidthInStore, | 12 | getAverageBandwidthInStore, |
13 | getStoredMute, | 13 | getStoredMute, |
14 | getStoredVolume, | 14 | getStoredVolume, |
@@ -82,6 +82,7 @@ class PeerTubePlugin extends Plugin { | |||
82 | 82 | ||
83 | // Disable auto play on iOS | 83 | // Disable auto play on iOS |
84 | this.autoplay = options.autoplay && this.isIOS() === false | 84 | this.autoplay = options.autoplay && this.isIOS() === false |
85 | this.playerRefusedP2P = !getStoredWebTorrentEnabled() | ||
85 | 86 | ||
86 | this.startTime = timeToInt(options.startTime) | 87 | this.startTime = timeToInt(options.startTime) |
87 | this.videoFiles = options.videoFiles | 88 | this.videoFiles = options.videoFiles |
@@ -99,7 +100,6 @@ class PeerTubePlugin extends Plugin { | |||
99 | if (volume !== undefined) this.player.volume(volume) | 100 | if (volume !== undefined) this.player.volume(volume) |
100 | const muted = getStoredMute() | 101 | const muted = getStoredMute() |
101 | if (muted !== undefined) this.player.muted(muted) | 102 | if (muted !== undefined) this.player.muted(muted) |
102 | this.playerRefusedP2P = getStoredWebTorrentPolicy() || false | ||
103 | 103 | ||
104 | this.initializePlayer() | 104 | this.initializePlayer() |
105 | this.runTorrentInfoScheduler() | 105 | this.runTorrentInfoScheduler() |
@@ -291,7 +291,6 @@ class PeerTubePlugin extends Plugin { | |||
291 | renderVideo(torrent.files[ 0 ], this.playerElement, renderVideoOptions, (err, renderer) => { | 291 | renderVideo(torrent.files[ 0 ], this.playerElement, renderVideoOptions, (err, renderer) => { |
292 | this.renderer = renderer | 292 | this.renderer = renderer |
293 | 293 | ||
294 | console.log('value this.playerRefusedP2P', this.playerRefusedP2P) | ||
295 | if (err || this.playerRefusedP2P) return this.fallbackToHttp(done) | 294 | if (err || this.playerRefusedP2P) return this.fallbackToHttp(done) |
296 | 295 | ||
297 | return this.tryToPlay(err => { | 296 | return this.tryToPlay(err => { |