Show Active Speaker

Hello everyone,

I try to show active speaker on a canvas, it works perfectly on web but on mobile it glitches. Is there any other approach to this situation?

client.on('active-speaker', (payload) => {
      setNowTalkingId(prevTalking => {
          let userId = payload[0].userId
          if (prevTalking != userId && userIdRef.current != userId && userIdRef.current != null){
              let acrossVideoCanvas = document.querySelector('#videoFrameAcross')
              try {
                  mediaStreamRef.current?.stopRenderVideo(
                      acrossVideoCanvas,
                      prevTalking,
                      undefined,
                      undefined,
                      undefined,
                      userId
                  )
                  if(client.getAllUser().filter((user) => {return user.userId === userId})[0]?.bVideoOn) {
                      mediaStreamRef.current?.renderVideo(acrossVideoCanvas, userId, 1280, 720, 0, 0, 2)
                  }
                  return userId
              } catch (error) {
                  return prevTalking
              }
          }else{
              return prevTalking
          }
      })
  })

Hey @uyaniksigma

Thanks for your feedback.

Are there any errors on the console when the code run on the mobile browser?

Thanks
Vic

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.