I am trying to setup a webrtc peerconnection, but on receiving remote tracks no video or audio is playing in the html video element.
I think the issue is with multipal tracks that I am receiving, a total of 4 with 2 video and 2 audio tracks, Images Attached.
Note:- Offer, Answer and ICE candidate setup is working fine!
RemoteVideoRef.current.srcObject = new MediaStream();
peerconnection.ontrack = (event) => {
event.streams[0].getTracks().forEach((track) => {
RemoteVideoRef.current.srcObject.addTrack(track);
});
};