diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/src/assets/player/shared/manager-options/hls-options-builder.ts | 7 | ||||
-rw-r--r-- | client/src/assets/player/shared/manager-options/manager-options-builder.ts | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/client/src/assets/player/shared/manager-options/hls-options-builder.ts b/client/src/assets/player/shared/manager-options/hls-options-builder.ts index a572febc2..361c76f4b 100644 --- a/client/src/assets/player/shared/manager-options/hls-options-builder.ts +++ b/client/src/assets/player/shared/manager-options/hls-options-builder.ts | |||
@@ -19,12 +19,15 @@ export class HLSOptionsBuilder { | |||
19 | 19 | ||
20 | } | 20 | } |
21 | 21 | ||
22 | getPluginOptions () { | 22 | async getPluginOptions () { |
23 | const commonOptions = this.options.common | 23 | const commonOptions = this.options.common |
24 | 24 | ||
25 | const redundancyUrlManager = new RedundancyUrlManager(this.options.p2pMediaLoader.redundancyBaseUrls) | 25 | const redundancyUrlManager = new RedundancyUrlManager(this.options.p2pMediaLoader.redundancyBaseUrls) |
26 | 26 | ||
27 | const p2pMediaLoaderConfig = this.getP2PMediaLoaderOptions(redundancyUrlManager) | 27 | const p2pMediaLoaderConfig = await this.options.pluginsManager.runHook( |
28 | 'filter:internal.player.p2p-media-loader.options.result', | ||
29 | this.getP2PMediaLoaderOptions(redundancyUrlManager) | ||
30 | ) | ||
28 | const loader = new this.p2pMediaLoaderModule.Engine(p2pMediaLoaderConfig).createLoaderClass() as P2PMediaLoader | 31 | const loader = new this.p2pMediaLoaderModule.Engine(p2pMediaLoaderConfig).createLoaderClass() as P2PMediaLoader |
29 | 32 | ||
30 | const p2pMediaLoader: P2PMediaLoaderPluginOptions = { | 33 | const p2pMediaLoader: P2PMediaLoaderPluginOptions = { |
diff --git a/client/src/assets/player/shared/manager-options/manager-options-builder.ts b/client/src/assets/player/shared/manager-options/manager-options-builder.ts index 07678493d..2d96c9410 100644 --- a/client/src/assets/player/shared/manager-options/manager-options-builder.ts +++ b/client/src/assets/player/shared/manager-options/manager-options-builder.ts | |||
@@ -20,7 +20,7 @@ export class ManagerOptionsBuilder { | |||
20 | 20 | ||
21 | } | 21 | } |
22 | 22 | ||
23 | getVideojsOptions (alreadyPlayed: boolean): videojs.PlayerOptions { | 23 | async getVideojsOptions (alreadyPlayed: boolean): Promise<videojs.PlayerOptions> { |
24 | const commonOptions = this.options.common | 24 | const commonOptions = this.options.common |
25 | 25 | ||
26 | let autoplay = this.getAutoPlayValue(commonOptions.autoplay, alreadyPlayed) | 26 | let autoplay = this.getAutoPlayValue(commonOptions.autoplay, alreadyPlayed) |
@@ -61,7 +61,7 @@ export class ManagerOptionsBuilder { | |||
61 | 61 | ||
62 | if (this.mode === 'p2p-media-loader') { | 62 | if (this.mode === 'p2p-media-loader') { |
63 | const hlsOptionsBuilder = new HLSOptionsBuilder(this.options, this.p2pMediaLoaderModule) | 63 | const hlsOptionsBuilder = new HLSOptionsBuilder(this.options, this.p2pMediaLoaderModule) |
64 | const options = hlsOptionsBuilder.getPluginOptions() | 64 | const options = await hlsOptionsBuilder.getPluginOptions() |
65 | 65 | ||
66 | Object.assign(plugins, pick(options, [ 'hlsjs', 'p2pMediaLoader' ])) | 66 | Object.assign(plugins, pick(options, [ 'hlsjs', 'p2pMediaLoader' ])) |
67 | Object.assign(html5, options.html5) | 67 | Object.assign(html5, options.html5) |