-
Notifications
You must be signed in to change notification settings - Fork 22.5k
/
index.md
38 lines (26 loc) · 1.36 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
title: "RTCIceCandidatePair: local property"
short-title: local
slug: Web/API/RTCIceCandidatePair/local
page-type: web-api-instance-property
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.
## 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()")}}.
## Examples
This one-line example obtains the current candidate pair and then from that gets the local candidate.
```js
const candidatePair = pc
.getSenders()[0]
.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`.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}