Skip to content

Commit

Permalink
fix(FEC-14063): "Remove" errors in console for Download & transcript …
Browse files Browse the repository at this point in the history
…(transcript also failed to load)
  • Loading branch information
SivanA-Kaltura authored Jul 24, 2024
2 parents 46c6dcd + 40657db commit 944511a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/transcript-plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export class TranscriptPlugin extends KalturaPlayer.core.BasePlugin {
return this.player.getService('kalturaCuepoints') as any;
}

get audioPluginsManager(): {remove: (id: number) => void; add: (obj: object) => number} | null {
return (this.player.getService('AudioPluginsManager') as {remove: (id: number) => void; add: (obj: object) => number}) || null;
}

private get _data() {
return this._captionMap.get(this._activeCaptionMapId) || [];
}
Expand Down Expand Up @@ -364,8 +368,10 @@ export class TranscriptPlugin extends KalturaPlayer.core.BasePlugin {
}) as number;
} else {
const {displayName, svgIcon} = this;
// @ts-ignore
this._audioPlayerIconId = this.player.getService('AudioPluginsManager').add({displayName, svgIcon, onClick: (e) => this.open(e)});

if (this.audioPluginsManager) {
this._audioPlayerIconId = this.audioPluginsManager.add({displayName, svgIcon, onClick: () => this.open()});
}
}

if ((expandOnFirstPlay && !this._pluginState) || this._pluginState === PluginStates.OPENED) {
Expand Down Expand Up @@ -419,8 +425,7 @@ export class TranscriptPlugin extends KalturaPlayer.core.BasePlugin {
if (Math.max(this._transcriptPanel, this._transcriptIcon) > 0) {
this.sidePanelsManager?.remove(this._transcriptPanel);
this.upperBarManager!.remove(this._transcriptIcon);
// @ts-ignore
this.player.getService('AudioPluginsManager').remove(this._audioPlayerIconId);
this.audioPluginsManager?.remove(this._audioPlayerIconId);
this._transcriptPanel = -1;
this._transcriptIcon = -1;
this._audioPlayerIconId = -1;
Expand Down

0 comments on commit 944511a

Please sign in to comment.