Skip to content

Commit

Permalink
Merge pull request #6 from kaltura/FEC-13682-change-plugin-config
Browse files Browse the repository at this point in the history
fix(FEC-13682): fix default config issue
  • Loading branch information
semarche-kaltura committed Mar 1, 2024
2 parents f0ad71b + 91508dc commit db005aa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/doc-player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class PlaykitJsDocumentPlugin extends core.BasePlugin {
constructor(
name: string,
private player: any,
private config: DocumentPlayerConfig
config: DocumentPlayerConfig
) {
super(name, player, config);
DocumentPlayerEngine.getPlayerWidth = (): number => {
Expand All @@ -49,12 +49,14 @@ export class PlaykitJsDocumentPlugin extends core.BasePlugin {
}

private addUI(): void {
// @ts-ignore
const { basePreviewUrl, downloadDisabled } = this.config;
const docOverlayProps: DocumentOverlayProps = {
sourceName: this.player.sources.metadata?.name
};
if (this.config?.basePreviewUrl) {
docOverlayProps.onPreview = (): void => this.onPreview(`${this.config?.basePreviewUrl}${this.player.sources.id}`);
} else if (!this.config?.downloadDisabled) {
if (basePreviewUrl) {
docOverlayProps.onPreview = (): void => this.onPreview(`${basePreviewUrl}${this.player.sources.id}`);
} else if (!downloadDisabled) {
docOverlayProps.onDownload = this.onDownload;
}

Expand Down

0 comments on commit db005aa

Please sign in to comment.