JSFiddle - React, Tailwind, and code Playground

by xdumaine

JavaScript

window.navigator.mediaDevices.getUserMedia({audio:true}).then(() => {
  pc = new window.RTCPeerConnection();
  
  pc.setConfiguration({
        iceServers: [
          { urls: 'stun:stun1.l.google.com:19302?transport=udp' },
          { urls: 'stun:stun2.l.google.com:19302?transport=udp' }
        ]
      });
  pc.createDataChannel('test');
  pc.onicecandidate = e => {
    console.log('candidate', e.candidate)
  };
  pc.createOffer().then(o => pc.setLocalDescription(o));
  })