diff --git a/step-01/js/main.js b/step-01/js/main.js index 6a630db..96315d1 100644 --- a/step-01/js/main.js +++ b/step-01/js/main.js @@ -8,8 +8,12 @@ const mediaStreamConstraints = { // Video element where stream will be placed. const localVideo = document.querySelector('video'); +// Local stream that will be reproduced on the video. +let localStream; + // Handles success by adding the MediaStream to the video element. function gotLocalMediaStream(mediaStream) { + localStream = mediaStream; localVideo.srcObject = mediaStream; }