Tokbox屏幕共享问题 [英] Tokbox screenshare issue

查看:92
本文介绍了Tokbox屏幕共享问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用session.unpublish(Publisher)停止屏幕共享,然后重新发布视频流发布者以启动视频发布者,但是下次我启动屏幕共享时,会出现问题.

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.

在tokbox js中,停止屏幕共享的最佳方法是什么.

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

当screenshare位于AudioVideoPublisher和ScreenPublisher上时,实际上我有两个发布者,它们都位于不同的容器中,因为screenshare不会发布带有屏幕的音频,因此在这种情况下我也需要AudioVideoPublisher.

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.

推荐答案

停止发布的最佳方法是像执行操作一样调用unpublish,但是最好在再次发布之前等待streamDestroyed事件.例如.

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);

这篇关于Tokbox屏幕共享问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆