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

Merge pull request #5223 from Gyubin/develop

Fix the over creation of AudioContexts.
parents 39b20d13 4b92bc86
......@@ -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
......@@ -461,7 +463,8 @@ class WebRTCClass
stopAllPeerConnections: ->
for id, peerConnection of @peerConnections
@stopPeerConnection id
@stopPeerConnection id
window.audioContext.close()
setAudioEnabled: (enabled=true) ->
if @localStream?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment