【问题标题】:Reuse/reconnect receiver endpoint to new sender endpoint重用/重新连接接收方端点到新的发送方端点
【发布时间】:2016-07-21 10:48:51
【问题描述】:

我正在使用 node-js API 来使用 kurento。因此,我使用代码将发送方的 webrtcendpoint 连接到接收方端点 -

senderWebRtcEndPoint.connect(receiverWebRtcEndPoint, function(error) {
                if (error) {
                    return console.log("Error in connecting endpoints :: "+error);
                }
                io.log.info("EndPointConnected");
            });

使用此代码媒体开始流式传输到接收器。但是,如果发件人断开连接 -

  1. 如何断开接收端与发送端的连接?
  2. 如何销毁发送者端点?
  3. 如何从媒体管道释放该发送者端点?
  4. 创建新的发送者端点时,如何复用接收者的端点来连接新创建的发送者端点?

如果我能得到一个突出显示这些的示例(使用 JS-API)会更有帮助 -

  • 端点彼此断开
  • 销毁端点
  • 破坏管道
  • 将旧端点重新连接到新端点
  • 端点通知端点的任何事件都与其他端点连接和断开

【问题讨论】:

    标签: node.js webrtc kurento endpoints


    【解决方案1】:

    如何断开接收端与发送端的连接?

    如果您要释放发送者端点,则无需执行此操作。无论如何,有一个disconnect method

    receiverWebRtcEndPoint.disconnect(senderWebRtcEndPoint)
    

    如何销毁发件人端点? 如何从媒体管道释放该发送者端点?

    这些基本相同

    senderWebRtcEndPoint.release()
    

    如果您使用的是 Kurento Utils 库,请不要忘记从客户端对 WebRtcPeer 对象调用 dispose。如果您直接使用RTCPeerConnection,请同时使用close

    当新的发送者端点被创建时,如何复用接收者的端点来连接新创建的发送者端点?

    senderWebRtcEndPoint.connect(ReceivererWebRtcEndPoint)
    

    【讨论】:

      猜你喜欢
      • 2019-03-07
      • 1970-01-01
      • 1970-01-01
      • 2013-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-06
      • 1970-01-01
      相关资源
      最近更新 更多