code: function(stream) {
                      localStream = stream;
                      video.src = window.URL.createObjectURL(localMediaStream);
                      video.onloadedmetadata = function(e) {
                           // Do something with the video here.
                      };
                      d.resolve();
                  }
docs: successCallback