I'm using node-js API to use kurento. So, I connect sender's webrtcendpoint to receiver endpoint using code -
senderWebRtcEndPoint.connect(receiverWebRtcEndPoint, function(error) {
if (error) {
return console.log("Error in connecting endpoints :: "+error);
}
io.log.info("EndPointConnected");
});
Using this code media start streaming to receiver. But, if sender get disconnect -
It would be more helpful if I could get an example(using JS-API) highlighting these -
How to disconnect receiver endpoint to sender's endpoint?
If you are going to release the sender endpoint, there's no need to do this. In any case, there is a disconnect method
receiverWebRtcEndPoint.disconnect(senderWebRtcEndPoint)
How to destroy sender endpoint? How to release that sender endpoint from mediapipeline?
These are basically the same
senderWebRtcEndPoint.release()
Don't forget to invoke dispose
on the WebRtcPeer
object from the client, if you are using the Kurento Utils library. If you are using the RTCPeerConnection
directly, do also close that.
When new sender endpoint is created how to reuse the receiver's endpoint to connect newly created sender's endpoint?
senderWebRtcEndPoint.connect(ReceivererWebRtcEndPoint)