diff --git a/packages/roomkit-react/src/Prebuilt/components/Preview/PreviewForm.tsx b/packages/roomkit-react/src/Prebuilt/components/Preview/PreviewForm.tsx index ff42236635..644e537faf 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Preview/PreviewForm.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Preview/PreviewForm.tsx @@ -27,13 +27,16 @@ const PreviewForm = ({ e.preventDefault(); }; const isMobile = useMedia(cssConfig.media.md); - const { isHLSRunning, isRTMPRunning } = useRecordingStreaming(); + const { isHLSRunning, isRTMPRunning, isRecordingOn } = useRecordingStreaming(); const layout = useRoomLayout(); const { join_form: joinForm = {} } = layout?.screens?.preview?.default?.elements || {}; const showGoLive = - joinForm?.join_btn_type === JoinForm_JoinBtnType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE && !isHLSRunning && !isRTMPRunning; + joinForm?.join_btn_type === JoinForm_JoinBtnType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE && + !isHLSRunning && + !isRTMPRunning && + !isRecordingOn; return (
{ const showStreamingUI = useShowStreamingUI(); const hmsActions = useHMSActions(); const isConnected = useHMSStore(selectIsConnectedToRoom); - const { isHLSRunning, isRTMPRunning } = useRecordingStreaming(); + const { isHLSRunning, isRTMPRunning, isRecordingOn } = useRecordingStreaming(); const streamStartedRef = useRef(false); const startHLS = useCallback(async () => { @@ -44,10 +44,10 @@ export const useAutoStartStreaming = () => { }, [isHLSStarted, isHLSRunning]); useEffect(() => { - if (!isConnected || streamStartedRef.current || !permissions?.hlsStreaming) { + if (!isConnected || streamStartedRef.current || !permissions?.hlsStreaming || isRecordingOn) { return; } - // Is a streaming kit and broadcaster joins + // Is a streaming kit and peer with streaming permissions joins startHLS(); // eslint-disable-next-line react-hooks/exhaustive-deps }, [isConnected]);