我在我的应用程序中使用twilio可编程视频sdk。我已经使用Twilio Programmable Video创建了点对点视频聊天。每当我参加会议的时候。我可以看到和听到对方,但对方听不到我,也看不到我。创建房间和创建曲目都运行得很好。
await connect(token, {
audio: true,
name: this.meetingId,
video: { width: 640 }
}).then(room => {
this.meetingRoom = room;
// display the face of you
createLocalVideoTrack().then(track => {
const localMediaContainer = document.getElementById('local-media');
localMediaContainer.appendChild(track.attach());
});
room.on('participantConnected', participant => {
console.log(`Participant "${participant.identity}" connected`);
participant.tracks.forEach(publication => {
if (publication.isSubscribed) {
const track = publication.track;
document.getElementById('remote-media-div').appendChild(track.attach());
localStorage.setItem('status','live');
this.videoStyle('remote-media-div');
}
});这是我正在使用的代码片段。它是离子语言的。
发布于 2020-08-12 04:16:45
你应该倾听是否有任何参与者已经添加到房间中,用于相反的站点视图。
// Log any Participants already connected to the Room
room.participants.forEach(participant => {
console.log(`Participant "${participant.identity}" is connected to the Room`);
participant.tracks.forEach(publication => {
if (publication.isSubscribed) {
document.getElementById('remote-media-div').appendChild(publication.track.attach());
}
});
participant.on('trackSubscribed', track => {
document.getElementById('remote-media-div').appendChild(track.attach());
});
});https://stackoverflow.com/questions/62895027
复制相似问题