chagaif95

WebRTC-RN

Jul 1st, 2020
1,078
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let peerConnection = new RTCPeerConnection({ iceServers: [{ urls: 'stun:stun.l.google.com:19302' }] });
  2.  
  3. peerConnection.createOffer().then(sdp => peerConnection.setLocalDescription(sdp)).then(() => {
  4.       sdpVariable = peerConnection.localDescription.sdp;
  5.     }).catch((error) => {
  6.       console.log(error);
  7.     });
  8.  
  9. peerConnection.onicecandidate = e => {
  10.       console.log('onicecandidate');
  11.       window.setTimeout(() => {
  12.         console.log('window.setTimeout');
  13.         ws.send(msg);
  14.         }, 2000);
  15.     };
Advertisement
Add Comment
Please, Sign In to add comment