 			cancelButtonText: "No"
 		, (isConfirm) =>
 			if isConfirm
-				@joinCall()
+				@joinCall
+					audio: data.audio
+					video: data.video
 			else
 				@stop()
 
 
-	joinCall: ->
+	###
+		@param media {Object}
+			audio {Boolean}
+			video {Boolean}
+	###
+	joinCall: (media) ->
+		media ?=
+			audio: true
+			video: true
+
+		@media = media
+
 		@log 'joinCall', arguments
 		@getLocalUserMedia =>
 			console.log 'join call getLocalUserMedia'

		for id, peerConnection of @peerConnections
			@stopPeerConnection id

	startCall: (media={}) ->
		@log 'startCall', arguments
		@media = media
		@getLocalUserMedia =>
			@active = true
			@transport.startCall()


	###
		@param data {Object}
			from {String}
	###
	onRemoteCall: (data) ->
		swal
			title: "Video call from "+data.from
			text: "Do you want to accept?"
			type: "warning"
			showCancelButton: true

					if @callbacks['onRemoteStatus']?.length > 0
						fn(data) for fn in @callbacks['onRemoteStatus']

	startCall: (media) ->
		@log 'WebRTCTransportClass - startCall', @webrtcInstance.room, @webrtcInstance.selfId
		RocketChat.Notifications.notifyRoom @webrtcInstance.room, 'webrtc', 'call',
			from: @webrtcInstance.selfId
			audio: media.audio
			video: media.video

	joinCall: (media) ->
		@log 'WebRTCTransportClass - joinCall', @webrtcInstance.room, @webrtcInstance.selfId
