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

Drop firefox empty string candidates #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

athouary
Copy link

@athouary athouary commented Apr 22, 2020

Initial issue: otalk/sdp-jingle-json#29

These changes will prevent the error TypeError: parts[2] is undefined from occurring when Firefox uses empty string candidates that can't be parsed properly.

@nels83
Copy link

nels83 commented Jun 1, 2020

According to MDN : https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate/candidate an empty string "is known as the "end-of-candidates" marker".

Maybe changing
if (event.candidate) {
to
if (event.candidate && event.candidate.candidate.length) {

should be better since it will emit endOfCandidates ?

@athouary
Copy link
Author

athouary commented Jun 1, 2020

I believe I tested what you are suggesting and got unexpected results, but I'm not so sure anymore, even though it does sound like the right thing to do.

I'm not sure that I'll take the time to update the PR since I worked around the issue by not using the RTCPeerConnection module anymore, so feel free to create another PR if you want your suggested change to be merged.

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

Successfully merging this pull request may close these issues.

2 participants