peers / peerjs

Simple peer-to-peer with WebRTC.
https://peerjs.com
MIT License
12.48k stars 1.43k forks source link

Unable to communicate between iOS/MacOS to Windows 10 #535

Closed nhducseuit closed 5 years ago

nhducseuit commented 5 years ago

I've got following error:

Uncaught TypeError: Cannot read property 'readyState' of undefined
    at e.cleanup (main.00964d37d7b2ca5b80ca.js:1)
    at t.close (main.00964d37d7b2ca5b80ca.js:1)
    at RTCPeerConnection.e.oniceconnectionstatechange (main.00964d37d7b2ca5b80ca.js:1)

My simple project uses the shared peerjs server to connect and send an increasing number every 3s. See https://passenger-location-share.firebaseapp.com/ and press Track passengers on a browser/tab and on another browser/tab, press passenger on the way to start sending messages.

Some tests I've done and results:

Please help to take a look. Thank you


Update: I've confirmed this issue on demo as well https://jmcker.github.io/Peer-to-Peer-Cue-System/

kidandcat commented 5 years ago

Could you try with https://github.com/peers/peerjs/tree/v2.0.0?

bilo1967 commented 5 years ago

The same is happening for me running latest Chrome+Win10/7 vs Chrome+macOS and also for Chrome+Win10/7 vs Chrome+Android 8.1.

BTW it's not happening using PeerJS v2.0, at least with Chrome+Win10/7 vs Chrome+Android8 and Chrome+Win10/7 vs Chrome+macOS. Also, got it working with Chrome+Win10 vs Firefox+Win10.

nhducseuit commented 5 years ago

I wonder, how do you use v2.0. It doesn't have API document.

bilo1967 commented 5 years ago

Not really using it yet, just testing. I played a little with the provided example which is quite clear even if API calls are not documented. Many features are still missing (*) but the new API 2.0 seems simpler to use than v1, and for multipart connections it does almost everything by itself.

(*) Especially handling of disconnections and metadata, as far as the project I'm developing is concerned. There should be also the possibility to "nicely" reject a call instead of letting the peer timing out, which is something I need.

afrokick commented 5 years ago

The issue was fixed in #520 ( version 1.0.1 )