ijt
ijt

Reputation: 3845

In the Twilio video JavaScript API, how can I get the SID of the local participant?

I have this code:

      room = await Video.connect(token, { name: roomName });
      room.participants.forEach(participantConnected);
      room.on('participantConnected', participantConnected);

It calls participantConnected for everyone except the user whose browser this is. How do I get the local participant?

Upvotes: 0

Views: 97

Answers (1)

Pavlo Shchur
Pavlo Shchur

Reputation: 56

You can get the SID of the local participant in the following way:

room.localParticipant.sid

Upvotes: 1

Related Questions