From 6ec0b75beb9c8bcd84e178912319913b91830da2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 6 Feb 2019 10:39:50 +0100 Subject: Fallback HLS to webtorrent --- .../assets/player/p2p-media-loader/p2p-media-loader-plugin.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'client/src/assets/player/p2p-media-loader') 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 { src: options.src }) + player.on('play', () => { + player.addClass('vjs-has-big-play-button-clicked') + }) + player.ready(() => this.initialize()) } dispose () { + if (this.hlsjs) this.hlsjs.destroy() + if (this.p2pEngine) this.p2pEngine.destroy() + clearInterval(this.networkInfoInterval) } private initialize () { initHlsJsPlayer(this.hlsjs) - this.p2pEngine = this.player.tech_.options_.hlsjsConfig.loader.getEngine() + const tech = this.player.tech_ + this.p2pEngine = tech.options_.hlsjsConfig.loader.getEngine() // Avoid using constants to not import hls.hs // https://github.com/video-dev/hls.js/blob/master/src/events.js#L37 -- cgit v1.2.3