feross / simple-peer

📡 Simple WebRTC video, voice, and data channels
MIT License
7.44k stars 974 forks source link

iceConnectionStateChange state 'failed' should be handled as error #48

Closed max-mapper closed 8 years ago

max-mapper commented 9 years ago

the 'failed' state from https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/iceConnectionState is currently not handled:

https://github.com/feross/simple-peer/blob/ba0e925e7da56e144a9ab7f0075b5bec8af5c0dc/index.js#L347-L365

it should get handled as an error as currently it causes a silent hung fail state

yocontra commented 8 years ago

@maxogden Is the ideal behavior you see a destroy and an error event or something else?

RaulTsc commented 8 years ago

Related https://github.com/peers/peerjs/issues/181 . I'll look at both of these, create a PR and we'll go from there :)

max-mapper commented 8 years ago

oops never saw your reply @contra, sorry. my guess would be to just add 3 lines like this, but to handle 'failed' instead https://github.com/feross/simple-peer/blob/ba0e925e7da56e144a9ab7f0075b5bec8af5c0dc/index.js#L363-L365

feross commented 8 years ago

Released as 5.11.7.

ttejas123 commented 3 years ago

hello github code is on :- newVideo repo hosting:- https://pacific-sands-63780.herokuapp.com/

this code work properly when both users on same network(wifi, hotspot) but fail when network chenge (different wifi, mobile hotspot, network). I am facing ( peerConection.connectionState: "Failed" and iceConnectionState: "disconnected")

jarretttaylor commented 3 years ago

@ttejas123 Despite the similarity in description, the opened issue is related to error handling while your specific issue is likely related to configuration. Take a look at #770 or search the existing issues for TURN. If you are correctly utilizing a TURN server and believe an error still exists within simple peer, please open a new/separate issue.