Closed Vakil-Parth closed 3 years ago
` createPeerConnection(_iceServers).then((connection) async { peerConnection = connection;
await peerConnection.setRemoteDescription( RTCSessionDescription(data['offer']['sdp'], data['offer']['type'])); peerConnection.onTrack = (event) { print('------------------------------ onTrack'); // never got this callback, works well with Web if (event.track.kind == 'video') { _localRenderer.srcObject = event.streams[0]; } }; RTCSessionDescription rtcSessionDescription = await peerConnection.createAnswer(); await peerConnection.setLocalDescription(rtcSessionDescription); RTCSessionDescription localSessionDescription = await peerConnection.getLocalDescription(); socket.emit( "answer", {'id': data['id'], 'description': localSessionDescription.sdp}); peerConnection.onIceCandidate = (candidate) { print('onIceCandidate'); socket.emit("candidate", { 'id': data['id'], 'candidate': { 'sdpMid': candidate.sdpMid, 'sdpMLineIndex': candidate.sdpMlineIndex, 'candidate': candidate.candidate } }); };
`
Found issue with chrome browser
` createPeerConnection(_iceServers).then((connection) async { peerConnection = connection;
`