Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).
Announcements
Intel Customer Support will be observing the Martin Luther King holiday on Monday, Jan. 17, and will return on Tues. Jan. 18.
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646
1135 Discussions

正在进行多人会议,有人加入可以监听到。但是监听不到participant或者stream的减少

li__zhang
Beginner
274 Views

场景:

正在进行多人会议, 其中一个人离开会议, 会导致其余参会者的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) })

})

0 Kudos
1 Solution
Li_C_Intel
Employee
274 Views

你提到的代码只是对用户加入后新增加的stream和participant添加了listener,

此外是否对join时就存在的相应对象添加了结束的listener?

conference.join((info) => {

  info.participants.forEach(...)

  info.remoteStreams.forEach(...)

  ...

})

View solution in original post

2 Replies
li__zhang
Beginner
274 Views

补充:当参会者离开, 调用的方法:

conference.leave()

publicationVideo && publicationVideo.stop()

publicationAudio && publicationAudio.stop()

publicationScreen && publicationScreen.stop()

 

Li_C_Intel
Employee
275 Views

你提到的代码只是对用户加入后新增加的stream和participant添加了listener,

此外是否对join时就存在的相应对象添加了结束的listener?

conference.join((info) => {

  info.participants.forEach(...)

  info.remoteStreams.forEach(...)

  ...

})

View solution in original post

Reply