Skip to content

Commit

Permalink
Make localStream visible on step-01
Browse files Browse the repository at this point in the history
  • Loading branch information
nitobuendia committed Jun 15, 2018
1 parent 14cadd4 commit bd387a2
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 bd387a2

Please sign in to comment.