diff --git a/app/src/InterstitialPage.tsx b/app/src/InterstitialPage.tsx index 70878e2..2068949 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={{ config: { 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 501d6bb..730b702 100644 --- a/src/interstitial/InterstitialPlayer.tsx +++ b/src/interstitial/InterstitialPlayer.tsx @@ -99,10 +99,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. */ @@ -134,12 +130,6 @@ export const InterstitialPlayer = React.memo((props: InterstitialPlayerProps) => enableFocus(props.enableFocus ?? true) }, [props.enableFocus]) - useEffect(() => { - if (props.patchIgnoreStateEnded) { - playerRef.current.ignoreStateEnded = true - } - }, [props.patchIgnoreStateEnded]) - const load = async () => { try { await playerRef.current.loadHlsi(props.asset)