Skip to content

Commit

Permalink
Change pullYospaceAdDataForLive to an arrow function
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinber committed Dec 5, 2024
1 parent e1029a1 commit 6ea259e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/ts/InternalBitmovinYospacePlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,7 @@ export class InternalBitmovinYospacePlayer implements BitmovinYospacePlayerAPI {
}

Logger.log('Loading Source: ' + stringify(clonedSource));
this.player
.load(clonedSource, forceTechnology, disableSeeking)
.then(this.pullYospaceAdDataForLive)
.then(resolve)
.catch(reject);
this.player.load(clonedSource, forceTechnology, disableSeeking).then(this.pullYospaceAdDataForLive).then(resolve).catch(reject);
} else {
session.shutdown();
this.session = null;
Expand Down Expand Up @@ -390,7 +386,7 @@ export class InternalBitmovinYospacePlayer implements BitmovinYospacePlayerAPI {
return this.player.play(issuer);
}

private pullYospaceAdDataForLive(): Promise<void> {
private pullYospaceAdDataForLive = (): Promise<void> => {
if (
(this.yospaceSourceConfig.assetType !== YospaceAssetType.DVRLIVE && this.yospaceSourceConfig.assetType !== YospaceAssetType.LINEAR) ||
this.startSent
Expand All @@ -410,8 +406,8 @@ export class InternalBitmovinYospacePlayer implements BitmovinYospacePlayerAPI {

this.session.onPlayerEvent(YsPlayerEvent.PLAYBACK_READY, 0);

return adBreakUpdatePromise;
}
return adDataUpdatedPromise;
};

pause(issuer?: string): void {
this.playerPolicy.canPause() ? this.player.pause(issuer) : this.handleYospacePolicyEvent(YospacePolicyErrorCode.PAUSE_NOT_ALLOWED);
Expand Down

0 comments on commit 6ea259e

Please sign in to comment.