HenrikJoreteg / webrtc.js

WebRTC abstraction for managing it simple to manage multiple peer connections of various types.
http://simplewebrtc.com
158 stars 33 forks source link

Sending volume change events on datachannel seems to break removing streams in SimpleWebRTC #12

Open evelant opened 10 years ago

evelant commented 10 years ago

Sending volume change events c4acde900a52204268321f8d058f99397e85bf70 seems to break SimpleWebRTC removing video streams on remote clients when leaveRoom() is called.

JS console spits out

Uncaught NetworkError: Failed to execute 'send' on 'RTCDataChannel': Could not send data

It appears to attempt to write to the datachannel

dc.send(JSON.stringify({type: 'volume', volume: volume }));

even though the remote end called leaveRoom() and is no longer listening.

fippo commented 10 years ago

This seems like a race condition... can you reproduce this?

I'd be interested to see what the peer.pc.iceConnectionState and peer.pc.signalingState are.

lazd commented 10 years ago

This happened to me during testing... I had Chrome and Firefox connected, I refreshed Firefox and the error happened on the Chrome side. It doesn't happen consistently, however... Could this be related to https://github.com/HenrikJoreteg/RTCPeerConnection/issues/7?