Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let peerConnection = new RTCPeerConnection({ iceServers: [{ urls: 'stun:stun.l.google.com:19302' }] });
- peerConnection.createOffer().then(sdp => peerConnection.setLocalDescription(sdp)).then(() => {
- sdpVariable = peerConnection.localDescription.sdp;
- }).catch((error) => {
- console.log(error);
- });
- peerConnection.onicecandidate = e => {
- console.log('onicecandidate');
- window.setTimeout(() => {
- console.log('window.setTimeout');
- ws.send(msg);
- }, 2000);
- };
Advertisement
Add Comment
Please, Sign In to add comment