【问题标题】:opentok how to hide the publisher video displayopentok如何隐藏发布者视频显示
【发布时间】:2015-05-13 19:48:41
【问题描述】:

我正在使用 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);
  });

但两种情况下都会显示视频窗口。

【问题讨论】:

    标签: opentok


    【解决方案1】:

    查看以下文档:https://tokbox.com/opentok/tutorials/audio-video/js/#publish_audio_video_only

    如果您想在发布后禁用视频,您需要:

    publisher.publishVideo(false);
    

    【讨论】:

      【解决方案2】:

      https://tokbox.com/opentok/libraries/client/js/reference/OT.html#initPublisher

      相信你想要pubOptions = {publishVideo: false, style:{buttonDisplayMode: 'off'}};

      【讨论】:

        【解决方案3】:

        我不确定你要找的是不是这个,但你可以试试……

        session.unpublish(); //取消发布您的流/视频

        session.forceUnpublish(); //取消发布您的流/视频并强制其他流也取消发布

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多