Don't turn on the web cam until sharing is begun

This commit is contained in:
Corey Johnson & Matt Colyer
2013-07-23 16:34:59 -07:00
parent 77acaf0a1a
commit 087c4c60a1
3 changed files with 4 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ class GuestSession
guest = doc.get('collaborationState.guest')
host = doc.get('collaborationState.host')
@mediaConnection = new MediaConnection(guest, host, isHost: false)
@mediaConnection.start()
waitForStream: (callback) ->
@mediaConnection.waitForStream callback

View File

@@ -37,6 +37,7 @@ class HostSession
start: ->
return if @isSharing()
@mediaConnection.start()
patrick.snapshot project.getPath(), (error, repoSnapshot) =>
throw new Error(error) if error

View File

@@ -13,6 +13,8 @@ class MediaConnection
isHost: null
constructor: (@local, @remote, {@isHost}={}) ->
start: ->
constraints = {video: true, audio: true}
navigator.webkitGetUserMedia constraints, @onUserMediaAvailable, @onUserMediaUnavailable