- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
场景:
正在进行多人会议, 其中一个人离开会议, 会导致其余参会者的video窗口卡顿, 我发现当前的participants和streams列表的确已经没有了这个人的信息, 但是其他参会者却没有监听到participant或者stream的变化, 就不会做相应的处理,导致了video窗口卡顿。(监听不到参会者的离开是概率性的, 30%)
附代码:
监听participant或者stream的变化:
conference.addEventListener('participantjoined', (event) => {
event.participant.addEventListener('left', (res) => {
console.log('left', event.participant.id)
})
conference.addEventListener('streamadded', (event) => {
stream.addEventListener('ended', () => { console.log('ended', stream.id) })
})
- Tags:
- HTML5
- JavaScript*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
你提到的代码只是对用户加入后新增加的stream和participant添加了listener,
此外是否对join时就存在的相应对象添加了结束的listener?
conference.join((info) => {
info.participants.forEach(...)
info.remoteStreams.forEach(...)
...
})
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
补充:当参会者离开, 调用的方法:
conference.leave()
publicationVideo && publicationVideo.stop()
publicationAudio && publicationAudio.stop()
publicationScreen && publicationScreen.stop()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
你提到的代码只是对用户加入后新增加的stream和participant添加了listener,
此外是否对join时就存在的相应对象添加了结束的listener?
conference.join((info) => {
info.participants.forEach(...)
info.remoteStreams.forEach(...)
...
})
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page