Skip to content

Commit

Permalink
Add removeCandidatePairs method.
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-vi committed Sep 6, 2023
1 parent e0e07a5 commit 9d5bfc3
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,7 @@ <h3>
attribute EventHandler onicecandidatepairremove;
attribute EventHandler onicecandidatepairnominate;
undefined setSelectedCandidatePair(RTCIceCandidatePair candidatePair);
undefined removeCandidatePairs(sequence&lt;RTCIceCandidatePair&gt; candidatePairs);
};</pre>
<section id="rtcicetransport-attributes">
<h2>Attributes</h2>
Expand Down Expand Up @@ -975,6 +976,67 @@ <h2>Methods</h2>
selected candidate pair =].
</p>
</dd>
<dt>
<dfn>removeCandidatePairs</dfn>
</dt>
<dd>
<p>
The {{removeCandidatePairs}} method immediately removes the provided candidate pairs, making them unavailable to use
for transport. The [= ICE agent =] may free up candidates once all the associated candidate pairs have been removed.
</p>
<p>
When this method is invoked, the [= user agent =] MUST run the following steps:
</p>
<ol class="algorithm">
<li>
<p>
Let |connection:RTCPeerConnection| be the {{RTCPeerConnection}} object associated with this [= ICE agent =].
</p>
</li>
<li>
<p>
If <var>connection</var>.{{RTCPeerConnection/[[IsClosed]]}} is
<code>true</code>, [= exception/throw =] an
{{InvalidStateError}}.
</p>
</li>
<li>
<p>
Let |transport:RTCIceTransport| be the associated {{RTCIceTransport}} object.
</p>
</li>
<li>
<p>
If |transport|.{{RTCIceTransport/[[IceTransportState]]}} is either of
{{RTCIceTransportState/"new"}}, {{RTCIceTransportState/"failed"}} or {{RTCIceTransportState/"closed"}}, [=
exception/throw =]
an {{InvalidStateError}}.
</p>
</li>
<li>
<p>
If |transport|.{{RTCIceTransport/[[ProposalPending]]}} is <code>true</code>, [= exception/throw =] an
{{InvalidStateError}}.
</p>
</li>
<li>
<p>
Instruct the [= ICE agent =] to remove the candidate pairs indicated by |candidatePairs|, ignoring any unknown
or invalid candidate pairs.
</p>
</li>
<li>
<p>
For each valid |removedPair| in |candidatePairs| that was removed by the [= ICE agent =], [= fire an event =] named
{{RTCIceTransport/icecandidatepairremove}}
at |transport|, using {{RTCIceCandidatePairEvent}}, with the
{{Event/cancelable}} attribute initialized to <code>false</code>, and the {{RTCIceCandidatePairEvent/local}}
and {{RTCIceCandidatePairEvent/remote}} attributes initialized to the local and remote candidates, respectively,
of |removedPair|.
</p>
</li>
</ol>
</dd>
</dl>
</section>
<section>
Expand Down

0 comments on commit 9d5bfc3

Please sign in to comment.