From 6be62fd672700acb461789f797b8bab67f56ec79 Mon Sep 17 00:00:00 2001 From: Tzipi-kaltura Date: Mon, 2 Sep 2024 18:31:04 +0300 Subject: [PATCH] check custom preset for every plugin --- src/kaltura-player.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/kaltura-player.ts b/src/kaltura-player.ts index 6b793737a..a3d80c024 100644 --- a/src/kaltura-player.ts +++ b/src/kaltura-player.ts @@ -115,7 +115,7 @@ export class KalturaPlayer extends FakeEventTarget { this._sessionIdCache = new SessionIdCache(); this._configEvaluator = new ConfigEvaluator(); this._configEvaluator.evaluatePluginsConfig(plugins, options); - this._addAudioPreset(options); + this._addCustomPreset(options); this._playbackStart = false; const noSourcesOptions = Utils.Object.mergeDeep({}, options); delete noSourcesOptions.plugins; @@ -831,16 +831,11 @@ export class KalturaPlayer extends FakeEventTarget { return this._localPlayer.Error; } - private _addAudioPreset(options: Partial): void { + private _addCustomPreset(options: Partial): void { if (options.plugins) { Object.keys(options.plugins).forEach((plugin) => { if (window.kalturaCustomPreset[plugin]) { - if (!window.kalturaCustomPresetMap) { - window.kalturaCustomPresetMap = {}; - } - if (!window.kalturaCustomPresetMap[options.ui!.targetId]) { - window.kalturaCustomPresetMap[options.ui!.targetId] = {}; - } + window.kalturaCustomPresetMap[options.ui!.targetId] = window.kalturaCustomPresetMap[options.ui!.targetId] || {}; window.kalturaCustomPresetMap[options.ui!.targetId][plugin] = window.kalturaCustomPreset[plugin]; } });