From ffacd78f21d4021b3c0f654ff63ef29ca7afcde3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 8 Jun 2021 10:17:47 +0200 Subject: Load embed api resolutions on init --- client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'client/src/assets') 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 4275a5e5e..f1bd9f0c4 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 @@ -124,6 +124,10 @@ class P2pMediaLoaderPlugin extends Plugin { this.trigger('resolutionChange', { auto: this.hlsjs.autoLevelEnabled, resolutionId: data.height }) }) + this.hlsjs.on(Hlsjs.Events.MANIFEST_LOADED, (_: any, data: any) => { + this.trigger('resolutionsLoaded') + }) + this.p2pEngine.on(Events.SegmentError, (segment: Segment, err) => { console.error('Segment error.', segment, err) -- cgit v1.2.3