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

usernameFragment Examples section contains method that does not exist #28171

Open
MartinHanak opened this issue Jul 25, 2023 · 1 comment
Open
Labels
area: WebRTC Needs help from someone with WebRTC domain knowledge Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help!

Comments

@MartinHanak
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate/usernameFragment

What specific section or headline is this issue about?

Examples

What information was incorrect, unhelpful, or incomplete?

Method getParameters() specified in the Examples section does not exist.

What did you expect to see?

I expected to find a method allowing me to compare usernameFragment between incoming ICE candidates and existing RTCPeerConnection.

Do you have any supporting links, references, or citations?

None

Do you have anything more you want to share?

It is possible to get around this issue by reading the sdp of remoteDescription directly and using regular expressions. Connection in the given example refers to an instance of a RTCPeerConnection. Result usernameFragment is equal to usernameFragment for the RTCPeerConnection and it can be compared with incoming ICE candidates' usernameFragment.

           const sdp = connection.remoteDescription?.sdp;

            if ( sdp ) {
                const iceUfragRegex = /a=ice-ufrag:(.+)\r?\n/;
                const match = sdp.match(iceUfragRegex);
                const usernameFragment = match ? match[1] : null;
            }

MDN metadata

Page report details
@MartinHanak MartinHanak added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jul 25, 2023
@github-actions github-actions bot added the Content:WebAPI Web API docs label Jul 25, 2023
@sideshowbarker
Copy link
Collaborator

RTCRtpReceiver objects do have a getParameters() method — https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/getParameters — but the RTCDtlsTransport object returned from receiver.transport doesn’t.

@sideshowbarker sideshowbarker added area: WebRTC Needs help from someone with WebRTC domain knowledge help wanted If you know something about this topic, we would love your help! and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: WebRTC Needs help from someone with WebRTC domain knowledge Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help!
Projects
None yet
Development

No branches or pull requests

2 participants