diff --git a/.changeset/early-loops-swim.md b/.changeset/early-loops-swim.md new file mode 100644 index 00000000..f67cbf80 --- /dev/null +++ b/.changeset/early-loops-swim.md @@ -0,0 +1,5 @@ +--- +'@theoplayer/yospace-connector-web': major +--- + +Removed `isPlaceholder()` and `isEncoded()` type definitions since they were removed in Yospace Ad Management SDK 3.11.0. diff --git a/.changeset/eleven-things-obey.md b/.changeset/eleven-things-obey.md new file mode 100644 index 00000000..adca320f --- /dev/null +++ b/.changeset/eleven-things-obey.md @@ -0,0 +1,5 @@ +--- +'@theoplayer/yospace-connector-web': major +--- + +Replaced `PlaybackMode` with `SessionMode` for compatibility with Yospace Ad Management SDK 3.10.0+. This change brings the minimum supported Yospace Ad Management SDK version to 3.10.0. diff --git a/.changeset/khaki-sloths-jump.md b/.changeset/khaki-sloths-jump.md new file mode 100644 index 00000000..5ff2a11d --- /dev/null +++ b/.changeset/khaki-sloths-jump.md @@ -0,0 +1,5 @@ +--- +'@theoplayer/yospace-connector-web': patch +--- + +Fixed an exception when an ad break starts without data during live playback. diff --git a/yospace/README.md b/yospace/README.md index e05b4500..caab7304 100644 --- a/yospace/README.md +++ b/yospace/README.md @@ -7,7 +7,7 @@ In order to use this connector, a [THEOplayer](https://www.npmjs.com/package/the For setting up a valid Yospace session, the Yospace Ad Management SDK is required. For more information on how to install the Ad Management SDK, please refer to the documentation of [Yospace](https://docs.yospace.com/library/technical/sdks/en/ad-management-sdks-v3/javascript.html). -**Remark:** This version of the Yospace Connector is compatible with Yospace Ad Management SDK version 3.5.2 or higher. If you still want to use an older Ad Management SDK, please use the connector version 1.4.0. +**Remark:** This version of the Yospace Connector is compatible with Yospace Ad Management SDK version 3.10.0 or higher. If you still want to use an older Ad Management SDK, please use the connector version 2.8.0 or earlier. ## Installation diff --git a/yospace/src/integration/YospaceAdHandler.ts b/yospace/src/integration/YospaceAdHandler.ts index ab920c92..39e8ebec 100644 --- a/yospace/src/integration/YospaceAdHandler.ts +++ b/yospace/src/integration/YospaceAdHandler.ts @@ -123,7 +123,14 @@ export class YospaceAdHandler { }; } - private onAdvertBreakStart(yospaceAdBreak: YospaceAdBreak) { + private onAdvertBreakStart(yospaceAdBreak: YospaceAdBreak | null) { + if (yospaceAdBreak === null) { + // During live playback, an ad break may be started without any information + this.currentAdBreak = this.adIntegrationController?.createAdBreak({ + timeOffset: this.player.currentTime + }); + return; + } this.currentAdBreak = this.getOrCreateAdBreak(yospaceAdBreak, true); } diff --git a/yospace/src/integration/YospaceManager.ts b/yospace/src/integration/YospaceManager.ts index afd91b12..4336db4f 100644 --- a/yospace/src/integration/YospaceManager.ts +++ b/yospace/src/integration/YospaceManager.ts @@ -7,7 +7,7 @@ import type { import { getFirstYospaceTypedSource, type YospaceTypedSource, yoSpaceWebSdkIsAvailable } from '../utils/YospaceUtils'; import { PlayerEvent } from '../yospace/PlayerEvent'; import { - PlaybackMode, + SessionMode, ResultCode, SessionState, type YospaceSession, @@ -298,7 +298,7 @@ export class YospaceManager extends DefaultEventDispatcher { } function isSessionDVRLive(session: YospaceSession): session is YospaceSessionDVRLive { - return session.getPlaybackMode() === PlaybackMode.DVRLIVE; + return session.getSessionMode() === SessionMode.DVRLIVE; } function createIntegrationHandler(yospaceManager: YospaceManager): ServerSideAdIntegrationHandler { diff --git a/yospace/src/yospace/AdBreak.ts b/yospace/src/yospace/AdBreak.ts index 929ade49..e9f38fb1 100644 --- a/yospace/src/yospace/AdBreak.ts +++ b/yospace/src/yospace/AdBreak.ts @@ -26,7 +26,6 @@ export interface Resource { getCreativeType(): string; getResourceType(): ResourceType; getStringData(): string; - isEncoded(): boolean; } export interface CreativeEventHandler { @@ -117,7 +116,6 @@ export interface AdBreak { getType(): BreakType; getDuration(): number; getIdentifier(): string; - isPlaceholder(): boolean; getPosition(): BreakPosition; getRemainingTime(): number; getStart(): number; diff --git a/yospace/src/yospace/YospaceSessionManager.ts b/yospace/src/yospace/YospaceSessionManager.ts index 4069f353..137c1190 100644 --- a/yospace/src/yospace/YospaceSessionManager.ts +++ b/yospace/src/yospace/YospaceSessionManager.ts @@ -18,7 +18,7 @@ export enum SessionState { SHUT_DOWN } -export enum PlaybackMode { +export enum SessionMode { LIVE = 0, DVRLIVE = 1, VOD = 2 @@ -31,7 +31,7 @@ export type YospaceSessionManagerCreator = { export interface YospaceSession { getAdBreakForAdvert(advert: AdVert): AdBreak | undefined; - getPlaybackMode(): PlaybackMode; + getSessionMode(): SessionMode; getPlaybackUrl(): string; @@ -53,7 +53,7 @@ export interface YospaceSession { } export interface YospaceSessionDVRLive extends YospaceSession { - getPlaybackMode(): PlaybackMode.DVRLIVE; + getSessionMode(): SessionMode.DVRLIVE; getDuration(): number; diff --git a/yospace/test/pages/main_esm.html b/yospace/test/pages/main_esm.html index 578a6808..75ac3217 100644 --- a/yospace/test/pages/main_esm.html +++ b/yospace/test/pages/main_esm.html @@ -25,7 +25,7 @@ const source = { sources: [ { - src: 'https://csm-e-sdk-validation.bln1.yospace.com/csm/extlive/yospace02,hlssample42.m3u8?yo.br=true&yo.av=4', + src: 'https://csm-e-sdk-validation-eb.bln1.yospace.com/csm/extlive/yosdk02,hls-ts-pre.m3u8?yo.av=5', ssai: { integration: 'yospace' } diff --git a/yospace/test/pages/main_umd.html b/yospace/test/pages/main_umd.html index aa5e3b2b..51f45a9f 100644 --- a/yospace/test/pages/main_umd.html +++ b/yospace/test/pages/main_umd.html @@ -25,7 +25,7 @@ const source = { sources: [ { - src: 'https://csm-e-sdk-validation.bln1.yospace.com/csm/extlive/yospace02,hlssample42.m3u8?yo.br=true&yo.av=4', + src: 'https://csm-e-sdk-validation-eb.bln1.yospace.com/csm/extlive/yosdk02,hls-ts-pre.m3u8?yo.av=5', ssai: { integration: 'yospace' }