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

Add RTCIceTransport method to remove candidate pairs #175

Merged
merged 14 commits into from
Jan 12, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 87 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,11 @@ <h3>
{{RTCIceTransport/onicecandidatepairadd}}, [= exception/throw =] a {{NotFoundError}}.
</p>
</li>
<li>
<p>
If |candidatePair| describes a [= candidate pair removed =] by the [= ICE agent =] or removed by the application by calling {{RTCIceTransport/removeCandidatePairs}}, [= exception/throw =] a {{NotFoundError}}.
sam-vi marked this conversation as resolved.
Show resolved Hide resolved
</p>
</li>
<li>
<p>
Instruct the [= ICE agent =] to use |candidatePair| to send data, and continue to the steps for a change in the selected
Expand All @@ -839,8 +844,7 @@ <h3>
candidate pair.
</p>
<p>
When the [= ICE agent =] has picked a candidate pair to remove, the [= user agent =] MUST [= queue a task =] to <dfn
id="rtcicetransport-remove">remove a candidate pair</dfn>:
When the [= ICE agent =] has picked a candidate pair to remove, the [= user agent =] MUST [= queue a task =] to <dfn data-lt="candidate pair removed" id="rtcicetransport-remove">remove a candidate pair</dfn>:
</p>
<ol class="algorithm">
<li>
Expand Down Expand Up @@ -916,6 +920,7 @@ <h3>
attribute EventHandler onicecandidatepairremove;
attribute EventHandler onicecandidatepairnominate;
undefined setSelectedCandidatePair(RTCIceCandidatePair candidatePair);
Promise&lt;undefined&gt; removeCandidatePairs(sequence&lt;RTCIceCandidatePair&gt; candidatePairs);
sam-vi marked this conversation as resolved.
Show resolved Hide resolved
};</pre>
<section id="rtcicetransport-attributes">
<h2>Attributes</h2>
Expand Down Expand Up @@ -975,6 +980,86 @@ <h2>Methods</h2>
selected candidate pair =].
</p>
</dd>
<dt>
<dfn>removeCandidatePairs</dfn>
</dt>
<dd>
<p>
The {{removeCandidatePairs}} method removes the provided candidate pairs, making them unavailable to use
sam-vi marked this conversation as resolved.
Show resolved Hide resolved
for transport. The [= ICE agent =] may free up candidates once all the associated candidate pairs have been removed.
sam-vi marked this conversation as resolved.
Show resolved Hide resolved
</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>
Let |p:Promise| be a new promise.
</p>
</li>
<li>
<p>
In parallel, instruct the [= ICE agent =] to remove the candidate pairs indicated by |candidatePairs|, ignoring any unknown or invalid candidate pairs.
sam-vi marked this conversation as resolved.
Show resolved Hide resolved
</p>
<ol>
<li>
<p>
When the [= ICE agent =] has completed the removal, [= queue a task =] to run the following steps:
</p>
<ol>
<li>
<p>
For each valid |removedPair| in |candidatePairs| that was removed by the [= ICE agent =], [= fire an event =] named {{RTCIceTransport/icecandidatepairremove}}
sam-vi marked this conversation as resolved.
Show resolved Hide resolved
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>
<li>
<p>
Resolve <var>p</var>.
</p>
</li>
</ol>
</li>
</ol>
</li>
<li>
<p>
Return <var>p</var>.
</p>
</li>
</ol>
</dd>
</dl>
</section>
<section>
Expand Down
Loading