diff --git a/src/ts/InternalBitmovinYospacePlayer.ts b/src/ts/InternalBitmovinYospacePlayer.ts index 65fb5c5..9970d7d 100644 --- a/src/ts/InternalBitmovinYospacePlayer.ts +++ b/src/ts/InternalBitmovinYospacePlayer.ts @@ -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; @@ -390,7 +386,7 @@ export class InternalBitmovinYospacePlayer implements BitmovinYospacePlayerAPI { return this.player.play(issuer); } - private pullYospaceAdDataForLive(): Promise { + private pullYospaceAdDataForLive = (): Promise => { if ( (this.yospaceSourceConfig.assetType !== YospaceAssetType.DVRLIVE && this.yospaceSourceConfig.assetType !== YospaceAssetType.LINEAR) || this.startSent @@ -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);