From f7c99618878a6f2179b163c3a33bd20f21cd426d Mon Sep 17 00:00:00 2001 From: Artur Finger Date: Mon, 9 Sep 2024 16:00:38 +0300 Subject: [PATCH] DE-7266: Remove `patchIgnoreStateEnded` This option was a workaround for a bug in the SDK (DE-7073). The bug has been since fixed so the workaround is no longer needed. --- app/src/InterstitialPage.tsx | 5 ----- src/Player.ts | 18 +----------------- src/interstitial/InterstitialPlayer.tsx | 10 ---------- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/app/src/InterstitialPage.tsx b/app/src/InterstitialPage.tsx index 5efc2b8..63a2102 100644 --- a/app/src/InterstitialPage.tsx +++ b/app/src/InterstitialPage.tsx @@ -30,11 +30,6 @@ export const InterstitialPage = () => { type: clpp.Type.HLS, }, }} - // Possibly it's something wrong with the AIP stream http://localhost:3000/vod-preroll.m3u8 - // but unfortunately what happens is that we get state "Ended" and then the video - // continues playing for another cca 800ms. This would obviously cause a glitch - // in the UI so configure the player to ignore all ended states changes - patchIgnoreStateEnded={true} hasTopControlsBar={false} interstitialOptions={{ // Start resolving X-ASSET-LIST 15 seconds or less before diff --git a/src/Player.ts b/src/Player.ts index 68c9538..13c0821 100644 --- a/src/Player.ts +++ b/src/Player.ts @@ -312,10 +312,6 @@ export class Player { * The last playback state */ private _lastPlaybackState: State = State.Unset - /** - * If true state changes to "ended" state should be ignored - */ - private _ignoreStateEnded = false /** * Timeline cues */ @@ -417,7 +413,7 @@ export class Player { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const previousState = toState(e.detail.previousState) - if (this._ignoreStateEnded && currentState === State.Ended) { + if (currentState === State.Ended) { return } @@ -544,18 +540,6 @@ export class Player { return this.pp_?.getTrackManager() ?? null } - /** - * Configure the player to ignore the "ended" state change. This is useful - * for situations where RESTOplay goes to the "ended" state prematurely, which - * sometimes happens (e.g. state changes to ended, but the video still plays - * another 800 ms or so and timeupdates are triggered). - * Not sure if this is a bug in PRESTOplay or a problem with the asset, but - * it happens. - */ - set ignoreStateEnded(value: boolean) { - this._ignoreStateEnded = value - } - /** * Seek to the given position. Calling this function has no effect unless the * presto instance is already initialized. diff --git a/src/interstitial/InterstitialPlayer.tsx b/src/interstitial/InterstitialPlayer.tsx index b6c925c..673d31b 100644 --- a/src/interstitial/InterstitialPlayer.tsx +++ b/src/interstitial/InterstitialPlayer.tsx @@ -98,10 +98,6 @@ export type InterstitialPlayerProps = { * Custom style for the player container. */ style?: React.CSSProperties - /** - * If true, the player will ignore all state changes to state "ended". - */ - patchIgnoreStateEnded?: boolean /** * Render a custom top companion component. */ @@ -125,12 +121,6 @@ export type InterstitialPlayerProps = { export const InterstitialPlayer = React.memo((props: InterstitialPlayerProps) => { const playerRef = useRef(new PlayerHlsi(props.onHlsiPlayerReady)) - useEffect(() => { - if (props.patchIgnoreStateEnded) { - playerRef.current.ignoreStateEnded = true - } - }, [props.patchIgnoreStateEnded]) - const load = async () => { try { await playerRef.current.loadHlsi(props.asset)