diff options
Diffstat (limited to 'client/src/assets/player/p2p-media-loader')
-rw-r--r-- | client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts | 10 |
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 |