Channel Participants

Channel Participants

A participant object represents a user that is connected to a given channel. You can get the list of participants from the AudioChannel object. You will also get a list of participants with the onParticipantsChanged event.

Example onParticipantsChanged Event Payload

  detail: {
    // currentParticipantId: This is the connectionId of the current user
    currentParticipantId: "871f35b5-479e-4b99-acba-71ab6fe50768",
    // Current Channel
    channel: AudioChannel{...},
    // List of participants in the channel
    participants: [Participant, Participant]      

Rendering Participants

function handleParticipantListChange(event) {
  const participants = event.detail.participants;
  let participantList = (participant) {
     return '<li>' + + (participant.muted ? '' : ' (speaking)') + '</li>';
  document.getElementById('channel-participants').innerHTML = `<ul>${participantList}</ul>`;

Last updated