Skip to content

Commit 93b2d7c

Browse files
authored
Merge pull request #88 from nitobuendia/globalvars
Make localStream visible on step-01
2 parents 14cadd4 + bd387a2 commit 93b2d7c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

step-01/js/main.js

+4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ const mediaStreamConstraints = {
88
// Video element where stream will be placed.
99
const localVideo = document.querySelector('video');
1010

11+
// Local stream that will be reproduced on the video.
12+
let localStream;
13+
1114
// Handles success by adding the MediaStream to the video element.
1215
function gotLocalMediaStream(mediaStream) {
16+
localStream = mediaStream;
1317
localVideo.srcObject = mediaStream;
1418
}
1519

0 commit comments

Comments
 (0)