aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/p2p-media-loader
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-06 10:39:50 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-02-11 09:13:02 +0100
commit6ec0b75beb9c8bcd84e178912319913b91830da2 (patch)
treed6fbcb774c5019fc20f42e8f9da4529545fdcbf9 /client/src/assets/player/p2p-media-loader
parent092092969633bbcf6d4891a083ea497a7d5c3154 (diff)
downloadPeerTube-6ec0b75beb9c8bcd84e178912319913b91830da2.tar.gz
PeerTube-6ec0b75beb9c8bcd84e178912319913b91830da2.tar.zst
PeerTube-6ec0b75beb9c8bcd84e178912319913b91830da2.zip
Fallback HLS to webtorrent
Diffstat (limited to 'client/src/assets/player/p2p-media-loader')
-rw-r--r--client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts b/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts
index f9a2707fb..022a9c16f 100644
--- a/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts
+++ b/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts
@@ -51,17 +51,25 @@ class P2pMediaLoaderPlugin extends Plugin {
51 src: options.src 51 src: options.src
52 }) 52 })
53 53
54 player.on('play', () => {
55 player.addClass('vjs-has-big-play-button-clicked')
56 })
57
54 player.ready(() => this.initialize()) 58 player.ready(() => this.initialize())
55 } 59 }
56 60
57 dispose () { 61 dispose () {
62 if (this.hlsjs) this.hlsjs.destroy()
63 if (this.p2pEngine) this.p2pEngine.destroy()
64
58 clearInterval(this.networkInfoInterval) 65 clearInterval(this.networkInfoInterval)
59 } 66 }
60 67
61 private initialize () { 68 private initialize () {
62 initHlsJsPlayer(this.hlsjs) 69 initHlsJsPlayer(this.hlsjs)
63 70
64 this.p2pEngine = this.player.tech_.options_.hlsjsConfig.loader.getEngine() 71 const tech = this.player.tech_
72 this.p2pEngine = tech.options_.hlsjsConfig.loader.getEngine()
65 73
66 // Avoid using constants to not import hls.hs 74 // Avoid using constants to not import hls.hs
67 // https://github.com/video-dev/hls.js/blob/master/src/events.js#L37 75 // https://github.com/video-dev/hls.js/blob/master/src/events.js#L37