Tokbox screenshare issue

↘锁芯ラ 提交于 2019-12-11 06:23:52

问题


I am using session.unpublish(Publisher) to stop screen share and then republish video stream publisher to start video publisher, but next time when I start screen share it creates problems.

In tokbox js what is the best way to stop screen share.

Actually I have two publisher when screenshare is on AudioVideoPublisher and ScreenPublisher both in different container as screenshare does not publish Audio with screen so I have also need AudioVideoPublisher in that case.


回答1:


The best way to stop the publishing is to call unpublish like you're doing but then it's best to wait for the streamDestroyed event before you publish again. eg.

publisher.on('streamDestroyed', function(event) {
  // publish again
  var publisher = OT.initPublisher();
  session.publish(publisher);
});
session.unpublish(publisher);


来源:https://stackoverflow.com/questions/46558434/tokbox-screenshare-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!