# Show Active Speaker

**URL:** <https://devforum.zoom.us/t/show-active-speaker/91931>\
**Category:** Web\
**Created:** [July 17, 2023, 4:28pm UTC](https://devforum.zoom.us/t/show-active-speaker/91931 "2023-07-17T16:28:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![uyaniksigma](https://avatars.discourse-cdn.com/v4/letter/u/bb73d2/32.png) [@uyaniksigma](https://devforum.zoom.us/u/uyaniksigma)\
**Post date:** [July 17, 2023, 4:28pm UTC](https://devforum.zoom.us/t/show-active-speaker/91931/1 "2023-07-17T16:28:31Z")

</div>

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?

```auto
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
          }
      })
  })

```

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [July 27, 2023, 10:45am UTC](https://devforum.zoom.us/t/show-active-speaker/91931/2 "2023-07-27T10:45:48Z")

</div>

Hey @uyaniksigma

Thanks for your feedback.

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

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [August 26, 2023, 8:46pm UTC](https://devforum.zoom.us/t/show-active-speaker/91931/3 "2023-08-26T20:46:33Z")

</div>

Closed on August 26, 2023, 8:46pm UTC

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