This message was deleted.
# helpdesk
s
This message was deleted.
p
hi @prehistoric-needle-99890 the
startAudio
is only visible in cases where the browser blocks auto-play of audio. In those cases it is necessary to initiate audio playback with a user gesture (thus the button). However it’s unexpected that some people wouldn’t be able to hear each other even after clicking the button. Can you observe a pattern in which users seem to have trouble hearing others? (e.g. browser / extensions etc.)
p
@polite-kilobyte-67570 ah i see. so there isn't a pattern to it we've noticed, is there some logging we can grab from the client side for you to check it out when it happens?
is there a possibility maybe the audio tracks of all the other participants hasn't been fully populated for this to work here: https://github.com/livekit/client-sdk-js/blob/9d4fc819476deef2e6bc90ba21e4b717dbecaefd/src/room/Room.ts#L659
p
after audio playback has started once all subsequent
attach
calls will auto play, so it shouldn’t matter if all/which tracks are populated in that array when running looping over it. you can listen to
RoomEvent.AudioPlaybackStatusChanged
and log that additional on the client side, this would definitely be helpful to see!
p
@polite-kilobyte-67570 sorry really struggling to figure out how to add listeners when using
LiveKitRoom
from livekit/components-react, i.e. i'm trying to add a listener for this page: https://github.com/livekit-examples/meet/blob/main/pages/custom/index.tsx
p
happy to help! this isn’t overly clear in the meet example. What you would want to do is to construct the room manually first and then pass it to
<LiveKitRoom room={myRoom} … />
. so something like
Copy code
... 
import { Room, LogLevel } from 'livekit-client';

export default function CustomRoomConnection() {
  ...
  const myRoom = new Room();
  const onPlayBackStatusChanged = React.useCallback((status) => {
    // actually handle the event
  }, []);
  myRoom.on(RoomEvent.AudioPlaybackStatusChanged, onPlaybackStatusChanged)
  ...
  return <LiveKitRoom room={myRoom} .... />
}
p
ah brilliant thanks