peers / peerjs

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

Failed to set local offer sdp: Called in wrong state: STATE_RECEIVEDINITIATE #286

Closed oooookk7 closed 6 years ago

oooookk7 commented 9 years ago

This issue occurs at times when Firefox v38 makes an attempt to call Chrome v42 and with Temasys AdapterJS integration when IE v11 is the one starting the call with Chrome v42.

semigroupoid commented 9 years ago

This might be a duplicate of #269. Does the error actually cause peerjs to stop working?

oooookk7 commented 9 years ago

Hi @semigroupoid, yes it does. I cannot have an established video call connection.

Ashwinkrishna commented 9 years ago

Hi I also got the same exception . Can anyone help me in fixing it .

chynonm commented 9 years ago

Just had this happen now. Using a slightly altered version of peerjs (adding a few things outside the peerconnection or mediastream) Both computers were connecting fine. Then by accident one of em was unplugged mid call. From then on haven't been able to get the 2 computers to share mediastream again, even after restarting peerjs server and having them refresh ids.

khandelwaludit commented 9 years ago

Hi, This issue is happening to me as well Failed to setLocalDescription, Failed to set local offer sdp. called in wrong state STATE_RECEIVED_INITIATE. Is there a workaround for this ?

chynonm commented 9 years ago

When it happens the way I fix it is restarting the computer that didn't crash, my understanding is it's probably storing some ice candidates and trying to connect the fastest way possible while the other side isn't prepared yet.

Didn't try a simple browser restart though (simple page refresh doesn't work)

carterbryden commented 9 years ago

I'm getting this as well, but on Chrome to Chrome connections. Doesn't seem to prevent the clients from connecting OK however.

W0lfEagle commented 9 years ago

Getting the same problem Chrome to Chrome. Any solutions yet?

vikrantkjain commented 8 years ago

## Failed to set local offer sdp: Called in wrong state: STATE_RECEIVEDOFFER

in android Native Develpment

mikkelking commented 8 years ago

Restarting the (chrome) browser made the problem go away for me, and I was able to make calls again

zkryakgul commented 6 years ago

## Failed to set local offer sdp: Called in wrong state: kHaveRemoteOffer

in android native WebChromeClient. Any solution?

AntonLebiodkin commented 6 years ago

+1, have kHaveRemoteOffer error, any solutions?

Sreekanthp74 commented 6 years ago

Am also getting the same error

peer.min.js:1 PeerJS: ERROR Error: (OperationError) Failed to set local offer sdp: Called in wrong state: kHaveRemoteOffer peer.min.js:1 PeerJS: Failed to setLocalDescription, (OperationError) Failed to set local offer sdp: Called in wrong state: kHaveRemoteOffer

Any solution for this?

zkryakgul commented 6 years ago

https://gitlab.com/zkry.akgul/peerjs

Use this instead of orginal lib. I made little touchs to lib files and seems like problem solved.

Zekeriya AKGÜL

Sreekanthp74 notifications@github.com, 16 Tem 2018 Pzt, 09:49 tarihinde şunu yazdı:

Am also getting the same error

peer.min.js:1 PeerJS: ERROR Error: (OperationError) Failed to set local offer sdp: Called in wrong state: kHaveRemoteOffer peer.min.js:1 PeerJS: Failed to setLocalDescription, (OperationError) Failed to set local offer sdp: Called in wrong state: kHaveRemoteOffer

Any solution for this?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/peers/peerjs/issues/286#issuecomment-405161144, or mute the thread https://github.com/notifications/unsubscribe-auth/APa-mKrHOdYzFnPTgsufeySFuT_v5MSdks5uHDd-gaJpZM4EQ5df .

kidandcat commented 6 years ago

Could you test with the latest build from master branch? in "dist" folder.

https://raw.githubusercontent.com/peers/peerjs/master/dist/peer.min.js

zkryakgul commented 6 years ago

Nope i couldn't. I work on it couple months ago and use it my small range project. It was worked for me.

16 Tem 2018 Pzt 10:49 tarihinde Jairo Caro-Accino Viciana < notifications@github.com> şunu yazdı:

Could you test with the latest build from master branch? in "dist" folder

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/peers/peerjs/issues/286#issuecomment-405170944, or mute the thread https://github.com/notifications/unsubscribe-auth/APa-mCcM4rP4UlXRkoWKR53JZbiTY4ZRks5uHEV9gaJpZM4EQ5df .

Sreekanthp74 commented 6 years ago

Thanks I checkout the latest peer.mim.js file and its working fine now.

but , @kidandcat the package you have given have the same issue.

Took it from the master git repo of peer js , it is working fine https://github.com/peers/peerjs

kidandcat commented 6 years ago

Mmm, it should be the same file, maybe your browser is catching it with an older version.

Anyway, feel free to reopen if you get the error again. Also I published the changes to NPM so you can use latest version from NPM now.

fibin commented 6 years ago

Now I have this issue: "OperationError: Failed to set local offer sdp: Called in wrong state: kHaveRemoteOffer". Trying to make connection between two browsers on one computer. @kidandcat can you help me with this?

kidandcat commented 6 years ago

Which PeerJS are you using?

fibin commented 6 years ago

@kidandcat 0.3.14

kidandcat commented 6 years ago

Update it, latest is 0.3.16

fibin commented 6 years ago

@kidandcat the error has gone! but still no audio. here is how I make call: navigator.getUserMedia({audio: true, video: true}, function(stream){ var call = this.peer.call(this.idToConnect, stream); call.on('stream', function(stream) { console.log('STREAM'); console.log(stream); }) }, err => console.log(err));

and this is how I revieve it: this.peer.on('call', function(call) { navigator.getUserMedia({ audio: true, video: true }, function(stream) { call.answer(stream); call.on('stream', function(stream) { console.log('RESPONED CALL'); console.log(stream) }); }, function(error) { //... }); });