0

We are building a P2P video call service using Twilio video. Is there a way for one user to know which device other user is using for video call so that we can change designs a bit to support that?

For eg, if one user is using Desktop and other user is on mobile, we want to notify Desktop user that the other user is on Mobile device.

Jayant Pareek
  • 360
  • 3
  • 18

1 Answers1

1

Twilio developer evangelist here.

You cannot pass metadata directly in the Video.connect method. But there are other ways to send metadata about a video call.

Naming tracks

The first thing that comes to mind is that you can name the tracks that you are sending. When you create a track, or pass options to Video.connect to create tracks, you can pass a name. For example, with a v

Video.createLocalVideoTrack({
  name: 'camera'
}).then(function(localTrack) {
  console.log(localTrack.name); // 'camera'
});

That track name will be sent with the published track and can be readable by remote participants.

The DataTrack API

For more involved messaging between participants, you can use DataTrack API. The DataTrack is another track, like audio and video, but it can be used to send arbitrary data payloads. Check out the docs on using the DataTrack API for more details.

philnash
  • 70,667
  • 10
  • 60
  • 88