diff --git a/src/common/plugins/plugins-config-store.ts b/src/common/plugins/plugins-config-store.ts index 8600c3d30..7c8d2d0ce 100644 --- a/src/common/plugins/plugins-config-store.ts +++ b/src/common/plugins/plugins-config-store.ts @@ -52,7 +52,9 @@ const defaultConfig: dataStoreType = { partnerId: '{{partnerId}}', uiConfId: '{{uiConfId}}', entryId: '{{entryId}}', - embedBaseUrl: '{{embedBaseUrl}}' + embedBaseUrl: '{{embedBaseUrl}}', + embedWidth: '{{embedWidth}}', + embedHeight: '{{embedHeight}}' } }; diff --git a/src/common/plugins/plugins-config.ts b/src/common/plugins/plugins-config.ts index a16432cc4..4237b0511 100644 --- a/src/common/plugins/plugins-config.ts +++ b/src/common/plugins/plugins-config.ts @@ -131,6 +131,12 @@ const getModel = (options: Partial): any => { } }); Utils.Object.mergeDeep(dataModel, entryDataModel); + + const {uiConfData} = options; + if (uiConfData) { + dataModel['embedWidth'] = uiConfData.width; + dataModel['embedHeight'] = uiConfData.height; + } return dataModel; }; diff --git a/src/kaltura-player.ts b/src/kaltura-player.ts index 3ad13cea6..0743787ff 100644 --- a/src/kaltura-player.ts +++ b/src/kaltura-player.ts @@ -57,8 +57,7 @@ import { hasYoutubeSource, maybeSetStreamPriority, mergeProviderPluginsConfig, - supportLegacyOptions, - getServerUIConf + supportLegacyOptions } from './common/utils/setup-helpers'; import { getDefaultRedirectOptions } from 'player-defaults'; import { addKalturaParams } from './common/utils/kaltura-params'; @@ -152,10 +151,6 @@ export class KalturaPlayer extends FakeEventTarget { this._localPlayer.setSources(sources || {}); } - public getUIConfData(): any { - return getServerUIConf().uiConfData || {}; - } - public async loadMedia(mediaInfo: ProviderMediaInfoObject, mediaOptions?: SourcesConfig): Promise { KalturaPlayer._logger.debug('loadMedia', mediaInfo); this._mediaInfo = mediaInfo; diff --git a/src/types/kaltura-player-options.ts b/src/types/kaltura-player-options.ts index 9f1998cd4..5f122be67 100644 --- a/src/types/kaltura-player-options.ts +++ b/src/types/kaltura-player-options.ts @@ -35,6 +35,7 @@ export interface KalturaPlayerConfig { viewability: ViewabilityConfig; network?: NetworkConfig; abr?: PKAbrConfigObject; + uiConfData?: UIConfDataObject; } export type PartialKPOptionsObject = Omit< @@ -52,3 +53,9 @@ export interface LegacyPartialKPOptionsObject { provider: ProviderOptionsObject; ui?: UiConfig; } + +export interface UIConfDataObject { + width?: string; + height?: string; + name?: string; +}