无法使用twilio视频访问参与者曲目

时间:2017-08-05 22:49:17

标签: twilio

我尝试使用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());
    });
  });
});

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

找到了显示如何添加参与者跟踪的examples