Async media stream

pull/25/head
Pontus Persson 2017-12-08 23:33:00 +01:00 committed by Pontus Alexander
parent fec90e59e9
commit 48e40d7690
1 changed files with 4 additions and 6 deletions

View File

@ -26,12 +26,10 @@ async function setup() {
audio: true,
};
navigator.mediaDevices.getUserMedia(constraints)
.then(stream => {
const stream = await navigator.mediaDevices.getUserMedia(constraints);
document.getElementById('localVideo').srcObject = stream;
peerConnection.addStream(stream);
extendOffer();
});
}
function extendOffer() {