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-37490): Align captions with clipTo/SeekFrom Values in PlayManifest #876

Merged
merged 5 commits into from
Nov 11, 2024
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
35 changes: 35 additions & 0 deletions src/kaltura-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ export class KalturaPlayer extends FakeEventTarget {
this.reset();
this._localPlayer.loadingMedia = true;
this._uiWrapper.setLoadingSpinnerState(true);
// TODO update sources config types in provider
this.handleSourceTimeRangeUpdate((mediaOptions as any)?.seekFrom, (mediaOptions as any)?.clipTo);

try {
const providerMediaConfig: ProviderMediaConfigObject = await this._provider.getMediaConfig(mediaInfo);
const mediaConfig = Utils.Object.copyDeep(providerMediaConfig);
Expand Down Expand Up @@ -1203,4 +1206,36 @@ export class KalturaPlayer extends FakeEventTarget {
public get sessionIdCache(): SessionIdCache | null {
return this._sessionIdCache;
}

private handleSourceTimeRangeUpdate(seekFrom: number | undefined, clipTo: number | undefined): void {
let ignoreManifestTextTracks = false;

if (typeof seekFrom === 'number') {
ignoreManifestTextTracks = true;
this._localPlayer.setSeekFrom(seekFrom);
}
if (typeof clipTo === 'number') {
ignoreManifestTextTracks = true;
this._localPlayer.setClipTo(clipTo);
}
if (ignoreManifestTextTracks) {
// TODO move this into adapters
this.configure({
playback: {
options: {
html5: {
hls: {
subtitleTrackController: null
},
dash: {
manifest: {
disableText: true
}
}
}
}
}
} as any);
}
}
}
Loading