Skip to content

Instantly share code, notes, and snippets.

@tokafish
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save tokafish/37aa2fda794e93e9d8ff to your computer and use it in GitHub Desktop.

Select an option

Save tokafish/37aa2fda794e93e9d8ff to your computer and use it in GitHub Desktop.
Adding video
navigator.getUserMedia({ video: true, audio: true }, function(stream) {
currentUser.stream = stream;
}, function() {});
// ...
peer = new SimplePeer({ stream: currentUser.stream });
peer.on('stream', function(stream) {
var video = document.querySelector("video");
video.src = window.URL.createObjectURL(stream);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment