3

I develop meeting applications with React and livekit.

I want to mute the voices of other users in the room, is there a good way to do this?

figalo66
  • 155
  • 6

1 Answers1

0

From the client side, first you need to acquire a list of the current RemoteTrackPublications, either through caching the objects returned on subscriptions or by querying a room's participants directly:

let remoteTrackPublications = room.participants.flatMap(participant => participant.audioTracks);

Once the list has been acquired, call setEnabled:

let deafen = true;
remoteTrackPublications.forEach(publication => publication.set_enabled(!deafen))
Mikayla Maki
  • 473
  • 6
  • 18