Registrations currently disabled due to spam. Contact me externally if you need an account

Commit b33113ae authored by Gabriel Engel's avatar Gabriel Engel Committed by GitHub
Browse files

Merge pull request #5223 from Gyubin/develop

Fix the over creation of AudioContexts.
parents 39b20d13 4b92bc86
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -228,10 +228,10 @@ class WebRTCClass
		if @active isnt true or @monitor is true or @remoteMonitoring is true then return

		remoteConnections = []
		for id, peerConnections of @peerConnections
		for id, peerConnection of @peerConnections
			remoteConnections.push
				id: id
				media: peerConnections.remoteMedia
				media: peerConnection.remoteMedia

		@transport.sendStatus
			media: @media
@@ -340,6 +340,8 @@ class WebRTCClass
				stream.addTrack(peer.stream.getAudioTracks()[0])
				stream.volume = volume

				this.audioContext = audioContext

			onSuccess(stream)

		navigator.getUserMedia media, onSuccessLocal, onError
@@ -462,6 +464,7 @@ class WebRTCClass
	stopAllPeerConnections: ->
		for id, peerConnection of @peerConnections
			@stopPeerConnection id
		window.audioContext.close()

	setAudioEnabled: (enabled=true) ->
		if @localStream?