Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(SUP-46361): Transcript visibility issue with VTT captions and Label usage in Kaltura Player v7. #234

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/transcript-plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class TranscriptPlugin extends KalturaPlayer.core.BasePlugin {
if (captionData.length) {
// take metadata from the first caption, as all captions in captionData have the same language and label
const captionMetadata = payload.cues[0].metadata;
const captionKey = this._makeCaptionKey(captionMetadata.language, captionMetadata.label);
const captionKey = captionMetadata.language || 'default';
this._addCaptionData(captionData, captionKey);
this._addTranscriptItem();
}
Expand Down Expand Up @@ -194,14 +194,9 @@ export class TranscriptPlugin extends KalturaPlayer.core.BasePlugin {
return this._activeCaptionMapId;
}
// use 1st captions from text-track list
return this._makeCaptionKey(allTextTracks[0]?.language, allTextTracks[0]?.label);
return allTextTracks[0]?.language || 'default';
}
return this._makeCaptionKey(activeTextTrack?.language, activeTextTrack?.label);
};

private _makeCaptionKey = (language?: string, label?: string): string => {
// use 'default' language as fallback when language argument is undefined or empty string
return `${language || 'default'}-${label}`;
return activeTextTrack?.language || 'default';
};

private _activatePlugin = (isFirstOpen = false) => {
Expand Down
Loading