I'm trying to implement a 2-person video call using the twilio video api. I can't seem to access the audio/video tracks for any participants, either already in teh room or through the participantConnected callback. The code in question, where I try to access the tracks from a newly joined participant is:
Twilio.Video.connect(token, {name:room_name}).then(function(room) {
console.log('Successfully joined a Room:');
//console.log(room);
room.on('participantConnected', function(participant) {
console.log('A remote Participant connected:');
console.log(participant.sid);
participant.tracks.forEach(track => {
//This does not get added and the console.log doesn't fire.
console.log('adding track');
document.getElementById('videoRow').appendChild(track.attach());
});
});
});
Thanks for any help!