From fee9ca121a4edae02c1af4f663eb8cb7e5054407 Mon Sep 17 00:00:00 2001 From: Tzipi-kaltura Date: Mon, 11 Nov 2024 14:56:08 +0200 Subject: [PATCH] fix(ADA-17): Playback button labels are generic and not video specific --- .../pre-playback-play-overlay-wrapper.tsx | 84 ++++++++++++------- 1 file changed, 52 insertions(+), 32 deletions(-) diff --git a/src/components/pre-playback-play-overlay-wrapper/pre-playback-play-overlay-wrapper.tsx b/src/components/pre-playback-play-overlay-wrapper/pre-playback-play-overlay-wrapper.tsx index 25192f2..90885f2 100644 --- a/src/components/pre-playback-play-overlay-wrapper/pre-playback-play-overlay-wrapper.tsx +++ b/src/components/pre-playback-play-overlay-wrapper/pre-playback-play-overlay-wrapper.tsx @@ -1,5 +1,6 @@ const {withText} = KalturaPlayer.ui.preacti18n; const {withEventManager} = KalturaPlayer.ui.Event; +const {withPlayer} = KalturaPlayer.ui.components; import {RelatedInternalEvent} from 'event'; import {useEffect, useState} from 'preact/hooks'; @@ -31,8 +32,10 @@ interface PrePlaybackPlayOverlayWrapperProps { onUnloaded: (cb: (isAutoContinueCancelled: boolean) => void) => void; next: string; startOver: string; + title: string; eventManager: KalturaPlayerTypes.EventManager; eventContext: KalturaPlayerTypes.FakeEventTarget; + player?: any; } /** @@ -48,42 +51,59 @@ interface PrePlaybackPlayOverlayWrapperProps { * @param {object} props.eventContext Event context. */ const PrePlaybackPlayOverlayWrapper = withEventManager( - withText({ - next: 'playlist.next', - startOver: 'controls.startOver' - })( - connect(mapStateToProps)( - ({isPlaybackEnded, sizeBreakpoint, relatedManager, next, startOver, eventManager, eventContext}: PrePlaybackPlayOverlayWrapperProps) => { - const [isAutoContinueCancelled, setIsAutoContinueCancelled] = useState(relatedManager.isAutoContinueCancelled); + withPlayer( + withText({ + next: 'playlist.next', + startOver: 'controls.startOver', + title: 'controls.title' + })( + connect(mapStateToProps)( + ({ + isPlaybackEnded, + sizeBreakpoint, + relatedManager, + next, + startOver, + title, + eventManager, + player, + eventContext + }: PrePlaybackPlayOverlayWrapperProps) => { + const [isAutoContinueCancelled, setIsAutoContinueCancelled] = useState(relatedManager.isAutoContinueCancelled); - useEffect(() => { - eventManager.listen(eventContext, RelatedInternalEvent.AUTO_CONTINUE_CANCELLED_CHANGED, ({payload}: {payload: boolean}) => { - setIsAutoContinueCancelled(payload); - }); - }, []); + useEffect(() => { + eventManager.listen(eventContext, RelatedInternalEvent.AUTO_CONTINUE_CANCELLED_CHANGED, ({payload}: {payload: boolean}) => { + setIsAutoContinueCancelled(payload); + }); + }, []); - if (!isPlaybackEnded) return ; - else if (isAutoContinueCancelled && (sizeBreakpoint === PLAYER_SIZE.SMALL || sizeBreakpoint === PLAYER_SIZE.EXTRA_SMALL)) { - return ( -
-
- - - - - - -
+ if (!isPlaybackEnded) return ; + else if (isAutoContinueCancelled && (sizeBreakpoint === PLAYER_SIZE.SMALL || sizeBreakpoint === PLAYER_SIZE.EXTRA_SMALL)) { + return ( +
+
+ + + + + + +
+
-
- ); + ); + } + return <>; } - return <>; - } + ) ) ) );