我使用的是OpenTok,我正在尝试打开/关闭视频显示。所以我使用以下pubOptions
var pubOptions;
if (show_video)
{
pubOptions= null;
}
else
{
pubOptions= { videoSource: null, style: {buttonDisplayModeo: 'off'}};
}
//Replace the first parameter with the replacement element ID:
session.on("streamCreated", function(event)
{
session.subscribe(event.stream);
});
session.connect(token, function(error)
{
publisher = OT.initPublisher("publisher_text",pubOptions);
session.publish(publisher);
});
但是在这两种情况下都会显示视频窗口。
发布于 2015-05-13 09:05:05
发布于 2015-05-12 20:08:02
https://tokbox.com/opentok/libraries/client/js/reference/OT.html#initPublisher
我相信你想要pubOptions = {publishVideo: false, style:{buttonDisplayMode: 'off'}};
发布于 2015-05-13 11:48:41
我不知道你想要的是不是这个,但你可以试试.
session.unpublish();//取消发布您的流/视频
session.forceUnpublish();//未发布的strea/视频,并强制其他流也未发布
https://stackoverflow.com/questions/30200066
复制相似问题