File tree Expand file tree Collapse file tree
sample-apps/react/egress-composite/src/hooks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 useEffect ,
77 useState ,
88} from 'react' ;
9- import { CallingState , useCallStateHooks } from '@stream-io/video-react-sdk' ;
109
1110const EgressReadyNotificationContext = createContext ( ( isReady : boolean ) => {
1211 // no-op
@@ -15,13 +14,10 @@ const EgressReadyNotificationContext = createContext((isReady: boolean) => {
1514
1615export const EgressReadyNotificationProvider = ( props : PropsWithChildren ) => {
1716 const [ isReady , setIsReady ] = useState ( false ) ;
18- const { useCallCallingState } = useCallStateHooks ( ) ;
19- const callingState = useCallCallingState ( ) ;
2017 useEffect ( ( ) => {
21- if ( isReady || callingState !== CallingState . JOINED ) return ;
18+ if ( isReady ) return ;
2219 // it could happen that components won't notify us that they are ready
2320 // in that case, we start recording anyway after 4 seconds.
24- console . log ( 'Egress: Started waiting for components to notify readiness' ) ;
2521 const timeout = setTimeout ( ( ) => {
2622 if ( ! isReady ) {
2723 console . log ( 'Timeout: Egress is ready' ) ;
@@ -32,7 +28,7 @@ export const EgressReadyNotificationProvider = (props: PropsWithChildren) => {
3228 return ( ) => {
3329 clearTimeout ( timeout ) ;
3430 } ;
35- } , [ callingState , isReady ] ) ;
31+ } , [ isReady ] ) ;
3632
3733 const spyIsReady = useCallback ( ( value : boolean ) => {
3834 setIsReady ( ( current ) => {
You can’t perform that action at this time.
0 commit comments