Skip to content

Instantly share code, notes, and snippets.

@shriyaRam
Created March 27, 2020 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shriyaRam/0d979fe1ba9cad98e7dda89c17f20851 to your computer and use it in GitHub Desktop.
Save shriyaRam/0d979fe1ba9cad98e7dda89c17f20851 to your computer and use it in GitHub Desktop.
async function start() {
console.log('Requesting local stream');
startButton.disabled = true;
try {
const stream = await navigator.mediaDevices.getUserMedia({audio: true, video: true});
console.log('Received local stream');
localVideo.srcObject = stream;
localStream = stream;
local_Video.srcObject = stream;
callButton.disabled = false;
} catch (e) {
alert(`getUserMedia() error: ${e.name}`);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment