Skip to content

Instantly share code, notes, and snippets.

@cozzbie
Last active January 17, 2018 19:54
Show Gist options
  • Save cozzbie/b306206023c20dca4891411a7a88a400 to your computer and use it in GitHub Desktop.
Save cozzbie/b306206023c20dca4891411a7a88a400 to your computer and use it in GitHub Desktop.
// Create Bobs WebRTC Peer. (same as Alice)
// ...
//Set Alice's description as the remote
bob.setRemoteDescription(new RTCSessionDescription(data)) // 'data' is the session description from Alice
.then(function(){
//Create answer
bob.createAnswer({ offerToRecieveAudio: 1, offerToReceiveVideo: 1 })
.then(function(description){
// Bob saves his description locally
bob.setLocalDescription(new RTCSessionDescription(description));
// Send this description to Alice. This action is seen as acceptance of the call from Alice.
// ...
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment