AgoraIO-Community / VideoUIKit-Web-React

A Web library to simply integrate Agora Video Calling or Live Video Streaming to your website with just a few lines of code.
MIT License
50 stars 40 forks source link

How do you listen for when new user join the channel? #31

Closed BMTCompany2 closed 10 months ago

BMTCompany2 commented 1 year ago

I would like to start recording the call when at least two users have joined the channel. How do I listen for when new users join the channel?

BMTCompany2 commented 1 year ago

Additionally, how can you change the control buttons and background colors? I saw how stuff can be customized in the Flutter Uikit but haven't seen anything for React.

marutifh commented 1 year ago

I would like to start recording the call when at least two users have joined the channel. How do I listen for when new users join the channel?

Did you get any response or identify the solution? @EkaanshArora

BMTCompany2 commented 1 year ago

I ended up figuring it out. This works for me <AgoraUIKit rtcProps={{ appId: process.env.REACT_APP_AGORA_APP_ID, channel: channelName, token: rtcToken, // add your token if using app in secured mode role, uid, layout: layout.grid, setVideoEncoder: { width: 1280, height: 720, }, }} styleProps={{ localBtnContainer: { backgroundColor: '#424242' }, }} // rtmProps={{ username: clientFullName, displayUsername: true }} callbacks={{ EndCall: () => endCallCleanup(), 'user-joined': () => startRecording(), }} /> image

You can see in the callbacks 'user-joined'. This has worked for me to catch when new people join the call.

Aoun2686 commented 1 year ago

any idea how to turn off camera when user leaves? my camera light remains on until i dont refresh the page. also, how can i pass initial settings for audio and video? i have a preparing screen where user choses to turn their camera on or off and for mic as well. i need to reflect those settings in video call.