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

OnnegotiationNeeded should get triggered after negotiation is done and still the negotiation is needed. #1491

Closed
st1992 opened this issue Oct 24, 2020 · 6 comments

Comments

@st1992
Copy link

st1992 commented Oct 24, 2020

Your environment.

  • Version: Latest
  • Browser: doesn't matter here

What did you do?

Added a track right after creating answer, but negotiation was not complete yet, but no onNegotiationNeeded is triggered ever , even after negotiation got completed.

What did you expect?

OnnegotiationNeeded should get triggered once negotiation is completed

What happened?

OnnegotiationNeeded was not fired.

It fires only when track is added after negotiation is completed.

@tarrencev
Copy link
Contributor

@sumeet-tiwari-samespace thanks for creating this issue. can you provide a test that reproduces this issue?

@st1992
Copy link
Author

st1992 commented Oct 26, 2020

@tarrencev
In any example , Lets say in simulcast example. After SetLocalDescription, add another new track. Like this

err = peerConnection.SetLocalDescription(answer)
	if err != nil {
		panic(err)
	}

outputTrack, err = peerConnection.NewTrack(videoCodecs[0].PayloadType, randutil.NewMathRandomGenerator().Uint32(), "video_x", "pion_x")
	if err != nil {
		panic(err)
	}
outputTracks["x"] = outputTrack

Then OnnegotiationNeeded should trigger after negotiation is done, coz the peerconnection still needs negotiation as the new track was added after creating answer.
The behaviour is explained here.
https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/onnegotiationneeded

@tekig
Copy link
Member

tekig commented Oct 28, 2020

@sumeet-tiwari-samespace you add a track to PeerConnection?

sender, err := peerConnection.AddTrack(outputTrack)

@st1992
Copy link
Author

st1992 commented Nov 2, 2020

yes @tekig

@tekig
Copy link
Member

tekig commented Nov 12, 2020

@sumeet-tiwari-samespace
I tried to reproduce the problem but there are no errors.
Earlier, for manual testing, an example was written that allowed creating/deleting tracks/channels locally/remotely, but it was very confusing and was deleted.
I added a track according to your example, here I added the addition of a new track as here, but negotiation passed as required.

I may have misunderstood your problem, can you please attach the full code for testing.

@Sean-Der
Copy link
Member

Sean-Der commented Aug 1, 2021

Resolving for lack of activity

@sumeet-tiwari-samespace if you are still have this issue/other repro ideas please re-open! thank you

@Sean-Der Sean-Der closed this as completed Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants