Skip to content

Commit bd387a2

Browse files
committed
Make localStream visible on step-01
1 parent 14cadd4 commit bd387a2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

step-01/js/main.js

Lines changed: 4 additions & 0 deletions
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)