Skip to content

Commit

Permalink
Fix property name iceTransport (mdn#33069)
Browse files Browse the repository at this point in the history
* Fix property name `iceTransport`

The property name `iceTransport` of `RTCDtlsTransport` is not `transport`.

* Update index.md - just some layout tidy

---------

Co-authored-by: Hamish Willee <[email protected]>
  • Loading branch information
Justme0 and hamishwillee authored Apr 15, 2024
1 parent 119706c commit 29b4592
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions files/en-us/web/api/rtcicecandidatepair/local/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,26 @@ browser-compat: api.RTCIceCandidatePair.local

{{APIRef("WebRTC")}}

The **`local`** property of the
**{{domxref("RTCIceCandidatePair")}}** dictionary specifies the
{{domxref("RTCIceCandidate")}} which describes the configuration of the local end of a
viable WebRTC connection.
The **`local`** property of the **{{domxref("RTCIceCandidatePair")}}** dictionary specifies the {{domxref("RTCIceCandidate")}} which describes the configuration of the local end of a viable WebRTC connection.

## Value

An {{domxref("RTCIceCandidate")}} which describes the configuration of the local end of
a viable pair of ICE candidates. The `RTCIceCandidatePair` is returned by the
{{domxref("RTCIceTransport")}} method
{{domxref("RTCIceTransport.getSelectedCandidatePair", "getSelectedCandidatePair()")}}.
An {{domxref("RTCIceCandidate")}} which describes the configuration of the local end of a viable pair of ICE candidates.
The `RTCIceCandidatePair` is returned by the {{domxref("RTCIceTransport")}} method {{domxref("RTCIceTransport.getSelectedCandidatePair", "getSelectedCandidatePair()")}}.

## Examples

This one-line example obtains the current candidate pair and then from that gets the
local candidate.
This one-line example obtains the current candidate pair and then from that gets the local candidate.

```js
const candidatePair = pc
.getSenders()[0]
.transport.transport.getSelectedCandidatePair();
.transport.iceTransport.getSelectedCandidatePair();
const localCandidate = candidatePair.local;
```

The {{domxref("RTCIceTransport")}} is found by getting the list of
{{domxref("RTCRtpSender")}} objects for the {{domxref("RTCPeerConnection")}}
`pc`. In the first `RTCRtpSender`, we get the
{{domxref("RTCDtlsTransport")}} over which the media data is being transmitted and
finally, from that, the `RTCIceTransport`.
The {{domxref("RTCIceTransport")}} is found by getting the list of {{domxref("RTCRtpSender")}} objects for the {{domxref("RTCPeerConnection")}} `pc`.
In the first `RTCRtpSender`, we get the {{domxref("RTCDtlsTransport")}} over which the media data is being transmitted and finally, from that, the `RTCIceTransport`.

## Specifications

Expand Down

0 comments on commit 29b4592

Please sign in to comment.