Skip to content

Instantly share code, notes, and snippets.

@ivmos
Last active August 29, 2015 14:10
Show Gist options
  • Save ivmos/6272bd4f5c626ab7a2bc to your computer and use it in GitHub Desktop.
Save ivmos/6272bd4f5c626ab7a2bc to your computer and use it in GitHub Desktop.
Intro to WebRTC: offer and pasting it to callee
<video id="v"/>
error = function (error) {
console.log(error);
};
pc = new webkitRTCPeerConnection({
"iceServers": []
});
navigator.webkitGetUserMedia({
video: true,
audio: true
},
function (localMediaStream) {
pc.addStream(localMediaStream);
pc.createOffer(function (offer) {
pc.setLocalDescription(offer, function () {
console.log(offer.sdp);
console.log("Paste on callee:");
console.log("receiveOffer(atob('" + btoa(offer.sdp) + "'))");
});
});
},
error);
name: Intro to WebRTC
description: offer and pasting it to callee
authors:
- Iván Mosquera Paulo
normalize_css: no
wrap: l
panel_js: 0
panel_css: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment