require(["UserMedia", "VideoWrapper"], function(UserMedia, VideoWrapper) {
    "use strict";

    var startButton = document.getElementById("startButton");
    startButton.onclick = startVideo;

    var userMedia = new UserMedia();

    function startVideo() {
        startButton.innerHTML = "Stop";
        startButton.onclick = stopVideo;

        if (userMedia.hasGetUserMedia()) {
            console.log('Good to go!');
            userMedia.queryCamera();
        } else {
            window.alert('getUserMedia() is not compatible in your browser');
        }
    }

    function stopVideo() {
        startButton.innerHTML = "Start";
        startButton.onclick = startVideo;

        userMedia.stopMedia();
    }
});

@@ -176,32 +176,37 @@
 lick = start
+Local
 Video;%0A%0A
     var user
@@ -189,24 +189,104 @@
 ocalVideo;%0A%0A
+    var videoWrapper = new VideoWrapper(document.getElementById('localVideo'));%0A
     var user
@@ -307,16 +307,28 @@
 erMedia(
+videoWrapper
 );%0A%0A    
@@ -337,24 +337,29 @@
 nction start
+Local
 Video() %7B%0A  
@@ -426,24 +426,29 @@
 click = stop
+Local
 Video;%0A%0A    
@@ -692,16 +692,21 @@
 ion stop
+Local
 Video() 
@@ -783,16 +783,21 @@
  = start
+Local
 Video;%0A%0A

Improve code readability