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.