Skip to content

Commit

Permalink
evaluate the embed width and height and remove the new api
Browse files Browse the repository at this point in the history
  • Loading branch information
lianbenjamin committed May 26, 2024
1 parent 083acc1 commit 015807f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/common/plugins/plugins-config-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ const defaultConfig: dataStoreType = {
partnerId: '{{partnerId}}',
uiConfId: '{{uiConfId}}',
entryId: '{{entryId}}',
embedBaseUrl: '{{embedBaseUrl}}'
embedBaseUrl: '{{embedBaseUrl}}',
embedWidth: '{{embedWidth}}',
embedHeight: '{{embedHeight}}'
}
};

Expand Down
6 changes: 6 additions & 0 deletions src/common/plugins/plugins-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ const getModel = (options: Partial<KalturaPlayerConfig>): any => {
}
});
Utils.Object.mergeDeep(dataModel, entryDataModel);

const {uiConfData} = options;

Check failure on line 135 in src/common/plugins/plugins-config.ts

View workflow job for this annotation

GitHub Actions / lint / running-tests (ubuntu-latest)

Replace `uiConfData` with `·uiConfData·`
if (uiConfData) {
dataModel['embedWidth'] = uiConfData.width;
dataModel['embedHeight'] = uiConfData.height;
}
return dataModel;
};

Expand Down
7 changes: 1 addition & 6 deletions src/kaltura-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<any> {
KalturaPlayer._logger.debug('loadMedia', mediaInfo);
this._mediaInfo = mediaInfo;
Expand Down
7 changes: 7 additions & 0 deletions src/types/kaltura-player-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface KalturaPlayerConfig {
viewability: ViewabilityConfig;
network?: NetworkConfig;
abr?: PKAbrConfigObject;
uiConfData?: UIConfDataObject;
}

export type PartialKPOptionsObject = Omit<
Expand All @@ -52,3 +53,9 @@ export interface LegacyPartialKPOptionsObject {
provider: ProviderOptionsObject;
ui?: UiConfig;
}

export interface UIConfDataObject {
width?: string;
height?: string;
name?: string;
}

0 comments on commit 015807f

Please sign in to comment.