Skip to content

Commit

Permalink
handle seekFrom and clipTo from URL
Browse files Browse the repository at this point in the history
  • Loading branch information
SivanA-Kaltura committed Nov 12, 2024
1 parent 61e2bff commit 013aa2d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/kaltura-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@ 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 @@ -271,6 +268,7 @@ export class KalturaPlayer extends FakeEventTarget {
delete localPlayerConfig.plugins;
if (localPlayerConfig.sources) {
const { sources } = localPlayerConfig;
this.handleSourcesTimeRangeUpdate(sources.seekFrom, sources.clipTo);
delete localPlayerConfig.sources;
this._localPlayer.configure(localPlayerConfig);
this._localPlayer.setSources(sources || {});
Expand Down Expand Up @@ -1207,7 +1205,7 @@ export class KalturaPlayer extends FakeEventTarget {
return this._sessionIdCache;
}

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

if (typeof seekFrom === 'number') {
Expand Down

0 comments on commit 013aa2d

Please sign in to comment.