I am trying to connect a unity client to a browser client using Webrtc. This step is complete the two clients are now connected (Signaling is complete). What I need to do next is to send the video stream from the c# Camera object to the other peer (browser). Here’s what have done which is not working and I do not know why?
The c# code :
var track = arCamera.CaptureStreamTrack(1280, 720, 3000);
localConnection.AddTrack(track);
Then I register the ontrack event for the RTCPeerConnection Object
The javascript code:
function handleTrack (e) {
console.log("Recieved a Track");
remotePeerVideo.current.srcObject = e.streams[0];
}
When I
console.log(e.streams); this is the result:
[MediaStream]
0:{active: true, id: "9322aaa7-69b6-4ef4-8f49-c457ef4ffd16"}
I add this track to the srcObj of a video element, but it does not work. Any Ideas what might be wrong or if there is another way to get the video stream from the c# Camera Object?