aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-videojs-plugin.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2018-10-12 18:12:39 +0200
committerRigel Kent <sendmemail@rigelk.eu>2018-10-13 11:53:48 +0200
commited638e5325096ef580da20f370ac61c59cd48cf7 (patch)
tree8ad4c1001efb3adc3946a6b6c9a3c1ed1f557995 /client/src/assets/player/peertube-videojs-plugin.ts
parent64cc5e8575fda47b281ae20abf0020e27fc8ce7c (diff)
downloadPeerTube-ed638e5325096ef580da20f370ac61c59cd48cf7.tar.gz
PeerTube-ed638e5325096ef580da20f370ac61c59cd48cf7.tar.zst
PeerTube-ed638e5325096ef580da20f370ac61c59cd48cf7.zip
move to boolean switch
Diffstat (limited to 'client/src/assets/player/peertube-videojs-plugin.ts')
-rw-r--r--client/src/assets/player/peertube-videojs-plugin.ts5
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
8import * as CacheChunkStore from 'cache-chunk-store' 8import * as CacheChunkStore from 'cache-chunk-store'
9import { PeertubeChunkStore } from './peertube-chunk-store' 9import { PeertubeChunkStore } from './peertube-chunk-store'
10import { 10import {
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 => {