我尝试使用twilio视频API实现2人视频通话。我似乎无法访问任何参与者的音频/视频曲目,无论是已经在房间还是通过ParticipConnected回调。我试图从新加入的参与者访问曲目的相关代码是:
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());
});
});
});
感谢您的帮助!