Skip to content

Commit

Permalink
Merge pull request #88 from nitobuendia/globalvars
Browse files Browse the repository at this point in the history
Make localStream visible on step-01
  • Loading branch information
samdutton authored Jun 15, 2018
2 parents 14cadd4 + bd387a2 commit 93b2d7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions step-01/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 93b2d7c

Please sign in to comment.