Microsoft Edge implements ORTC, a lower-level decentralized cousin of WebRTC that does not have a comprehensive RTCPeerConnection object.
But the good news is that adapter.js , the official WebRTC polyfill, RTCPeerConnection gaskets for you on Edge, so you should be able to use WebRTC in the same way in all browsers.
For example, this demo works for me in Edge, Firefox, and Chrome.
var pc1 = new RTCPeerConnection(), pc2 = new RTCPeerConnection(); navigator.mediaDevices.getUserMedia({ video: true, audio: true }) .then(stream => pc1.addStream(video1.srcObject = stream)) .catch(log); var add = (pc, can) => can && pc.addIceCandidate(can).catch(log); pc1.onicecandidate = e => add(pc2, e.candidate); pc2.onicecandidate = e => add(pc1, e.candidate); pc2.onaddstream = e => video2.srcObject = e.stream; pc1.oniceconnectionstatechange = e => log(pc1.iceConnectionState); pc1.onnegotiationneeded = e => pc1.createOffer().then(d => pc1.setLocalDescription(d)) .then(() => pc2.setRemoteDescription(pc1.localDescription)) .then(() => pc2.createAnswer()).then(d => pc2.setLocalDescription(d)) .then(() => pc1.setRemoteDescription(pc2.localDescription)) .catch(log); var log = msg => div.innerHTML += "<br>" + msg;
<video id="video1" width="160" height="120" autoplay muted></video> <video id="video2" width="160" height="120" autoplay></video><br> <div id="div"></div> <script src="https://webrtc.imtqy.com/adapter/adapter-latest.js"></script>
source share