question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Says on the iceConnectionState that is connected but does not run the onaddstream function

See original GitHub issue

Hey,

onaddstream not being fired.

I have a code like that that runs the ice connection state change and says that the this.pc.iceConnectionState is completed but the function this.pc.onaddstream never runs

I’ve tried refactoring the code and spliting in two components but i got the same behaviour

this.pc.oniceconnectionstatechange = () => {
  console.log('ICE STATE', this.pc.iceConnectionState);
  if (
    this.pc.iceConnectionState === 'failed' ||
    this.pc.iceConnectionState === 'disconnected' ||
    this.pc.iceConnectionState === 'closed'
  ) {
    console.log('Failed');
  } else if (this.pc.iceConnectionState === 'checking') {
    console.log('Checking');
  } else {
    this.setState({
      success: true,
    });
    console.log('Success');
  }
};

this.pc.onaddstream = e => {
  console.log('Stream event', e);
}

The expected result is to log the stream event when the event is completed.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
chilledJincommented, Aug 8, 2019

Should anyone hit this problem, I went through it before. Please make sure: did you addStream BEFORE you setRemoteDescription? If you didn’t, onaddstream will never be triggered. OnAddStreamEvent is triggered after setRemoteDescription and it will check if the sdp in the remoteDescription contains a stream.

1reaction
Seemapadiyacommented, Aug 22, 2019

@saghul i am not much idea about what i am doing wrong but in my cash i am getting always iceConnectionState first checking and then after some time its return failed. can you please guide me to solve the issues

Read more comments on GitHub >

github_iconTop Results From Across the Web

Says on the iceConnectionState that is connected but does ...
When the migration is complete, you will access your Teams at stackoverflowteams.com, and they will no longer appear in the left sidebar on ......
Read more >
RTCPeerConnection.iceConnectionState - Web APIs | MDN
iceConnectionState returns a string which state of the ICE agent associated with the RTCPeerConnection: new, checking, connected, completed, ...
Read more >
How to pass audio stream recorded with WebRTC to Google ...
It supports many locales and brings globalization in WebRTC! ... Says on the iceConnectionState that is connected but does not run the onaddstream...
Read more >
Re: [JsSIP] Ice restart on network change - Google Groups
This is clearly saying that no new candidates are found. Should they? ... 200 OK received and iceConnectionState changed to checking and then...
Read more >
18. WebRTC - High Performance Browser Networking [Book]
Real-Time Communication in Web-browsers (RTCWEB) is the IETF Working Group ... However, raw audio and video streams are also not sufficient on their...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found