Skip to content
Snippets Groups Projects
Commit 4b92bc86 authored by Gyubin Son's avatar Gyubin Son
Browse files

Fix the over creation of AudioContexts.

parent 39b20d13
No related branches found
No related tags found
No related merge requests found
......@@ -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?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment