Skip to content

Commit

Permalink
check custom preset for every plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Tzipi-kaltura committed Sep 2, 2024
1 parent 32cdd76 commit 6be62fd
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/kaltura-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -831,16 +831,11 @@ export class KalturaPlayer extends FakeEventTarget {
return this._localPlayer.Error;
}

private _addAudioPreset(options: Partial<KalturaPlayerConfig>): void {
private _addCustomPreset(options: Partial<KalturaPlayerConfig>): 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];
}
});
Expand Down

0 comments on commit 6be62fd

Please sign in to comment.