Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have error Uncaught RTCError: Transport channel closed #2

Open
tresnaa opened this issue Jun 5, 2020 · 4 comments
Open

I have error Uncaught RTCError: Transport channel closed #2

tresnaa opened this issue Jun 5, 2020 · 4 comments

Comments

@tresnaa
Copy link

tresnaa commented Jun 5, 2020

when the code running :

socket.on("receiving returned signal", payload => {
...

item.peer.signal(payload.signal); // i think this line make error

i found error like this :

Uncaught RTCError: Transport channel closed
Uncaught Error: Connection failed.
at makeError
at Peer._onConnectionStateChange
at RTCPeerConnection.Peer._pc.onconnectionstatechange

Please help me.

Thank you

@NikolasRoger
Copy link

NikolasRoger commented Jun 6, 2020

hi, i fixed that issue inserting this code on the client-side when user joined socket io channel


socketRef.current.on("user joined", payload => {
        const item = peersRef.current.find(p => p.peerID === payload.callerID);
        if(!item) {
          const peer = addPeer(payload.signal, payload.callerID, stream);
          peersRef.current.push({
            peerID: payload.callerID,
            peer,
          })
          setPeers(users => [...users, peer]);
        }
});

@tresnaa
Copy link
Author

tresnaa commented Jun 8, 2020

Thank you @NikolasRoger. The code works for me amazing!!
But, can you tell me, why that code must be inserting?

Thank you.

@ravi36683
Copy link

ravi36683 commented Sep 27, 2020

Hi @NikolasRoger , @coding-with-chaim

hi, i fixed that issue inserting this code on the client-side when user joined socket io channel


socketRef.current.on("user joined", payload => {
        const item = peersRef.current.find(p => p.peerID === payload.callerID);
        if(!item) {
          const peer = addPeer(payload.signal, payload.callerID, stream);
          peersRef.current.push({
            peerID: payload.callerID,
            peer,
          })
          setPeers(users => [...users, peer]);
        }
});

I've used this code but I'm still getting same error. Can you help me with this ?
Screenshot 2020-09-27 at 9 21 39 PM

Thank you,

@mukuldeep
Copy link

make sure the peer you are generating during runtime is persistent throughout. Once the page is loaded or state changed, weird errors may be encountered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants