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 initial FlexICE methods and attributes #33

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all 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
287 changes: 284 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ <h3><dfn>RTCIceGatherOptions</dfn> Dictionary</h3>
<pre class="idl">dictionary RTCIceGatherOptions {
RTCIceTransportPolicy gatherPolicy = "all";
sequence&lt;RTCIceServer&gt; iceServers;
sequence&lt;DOMString&gt;? networkIds;
};</pre>
<section>
<h2>Dictionary <a class="idlType">RTCIceGatherOptions</a> Members</h2>
Expand All @@ -152,6 +153,13 @@ <h2>Dictionary <a class="idlType">RTCIceGatherOptions</a> Members</h2>
provide default ICE servers, and applications can desire to restrict
communications to the local LAN, <var>iceServers</var> need not be set.</p>
</dd>
<dt><dfn><code>networkIds</code></dfn> of type <span class=
"idlMemberType">sequence&lt;<a>DOMString</a>&gt;</span></dt>
<dd>
<p>If set and non-null, ICE gathering will be limited to the network
interfaces specfied by the network IDs (obtained by
calling getLocalCandidates().</p>
</dd>
</dl>
</section>
</div>
Expand All @@ -167,8 +175,12 @@ <h3>Interface Definition</h3>
void start (RTCIceParameters remoteParameters, optional RTCIceRole role = "controlled");
void stop ();
void addRemoteCandidate (RTCIceCandidateInit remoteCandidate);
void retainLocalCandidate (RTCIceCandidateInit localCandidate);
void removeLocalCandidate (RTCIceCandidateInit localCandidate);
sequence&lt;RTCIceCandidatePair&gt; getCandidatePairs();
attribute EventHandler onerror;
attribute EventHandler onicecandidate;
attribute EventHandler onlocalcandidate;
attribute EventHandler onchecksent;
};</pre>
<section>
<h2>Constructors</h2>
Expand Down Expand Up @@ -213,12 +225,18 @@ <h2>Attributes</h2>
"MUST">MUST</em> be fired if an error occurs in the gathering of ICE
candidates (such as if TURN credentials are invalid).</p>
</dd>
<dt><dfn><code>onicecandidate</code></dfn> of type <span class=
<dt><dfn><code>onlocalcandidate</code></dfn> of type <span class=
"idlAttrType"><a>EventHandler</a></span></dt>
<dd>
<p>This event handler utilizes the event handler event type
<code><a>icecandidate</a></code>.
</dd>
<dt><dfn><code>onchecksent</code></dfn> of type <span class=
"idlAttrType"><a>EventHandler</a></span></dt>
<dd>
<p>This event handler utilizes the event handler event type
<code><a>icecheck</a></code>.
</dd>
</dl>
</section>
<section>
Expand Down Expand Up @@ -498,6 +516,263 @@ <h2>Methods</h2>
<em>Return type:</em> <code>void</code>
</div>
</dd>
<dt><dfn><code>removeLocalCandidate</code></dfn></dt>
<dd>
<p>Removes the given local candidate. This will trigger
the removal of all candidate pairs with the given local
candidate, the prevention of pairing with the given
local candidate, and prevention of any network activity
using the given local candidate.</p>
<table class="parameters">
<tbody>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Nullable</th>
<th>Optional</th>
<th>Description</th>
</tr>
<tr>
<td class="prmName">localCandidate</td>
<td class="prmType"><code><a>RTCIceCandidate</a></code></td>
<td class="prmNullFalse"><span role="img" aria-label=
"False">&#10008;</span></td>
<td class="prmOptFalse"><span role="img" aria-label=
"False">&#10008;</span></td>
<td class="prmDesc"></td>
</tr>
</tbody>
</table>
<div>
<em>Return type:</em> <code>void</code>
</div>
</dd>
<dt><dfn><code>retainLocalCandidate</code></dfn></dt>
<dd>
<p>Cause the <code><a>RTCIceTransport</a></code> to
not automatically remove the local candidate due
to ICE pruning (such as when a candidate pair with
a different local candidate is selected). However,
the local candidate may be removed if it completely
fails (such as a network interface going down).</p>
<table class="parameters">
<tbody>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Nullable</th>
<th>Optional</th>
<th>Description</th>
</tr>
<tr>
<td class="prmName">localCandidate</td>
<td class="prmType"><code><a>RTCIceCandidate</a></code></td>
<td class="prmNullFalse"><span role="img" aria-label=
"False">&#10008;</span></td>
<td class="prmOptFalse"><span role="img" aria-label=
"False">&#10008;</span></td>
<td class="prmDesc"></td>
</tr>
</tbody>
</table>
<div>
<em>Return type:</em> <code>void</code>
</div>
</dd>
<dt><dfn><code>getCandidatePairs()</code></dfn></dt>
<dd>
<p>Return all the candidate pairs.</p>
<div>
<em>Return type:</em> <code>sequence&lt;RTCIceCandidatePair&gt;</code>
</div>
</dd>
</dl>
</section>
<section id="rtcicecandidate-interface-definition*">
<h3>Interface Definition</h3>
<div>
<pre class="idl">[Exposed=Window]
partial dictionary RTCIceCandidateInit {
attribute DOMString? networkId;
// TODO: Add reference to https://wicg.github.io/netinfo/#dom-networkinformation
attribute NetworkInformation? networkInfo;
};</pre>
<section>
<h2>Attributes</h2>
<dl data-link-for="RTCIceCandidateInit" data-dfn-for="RTCIceCandidateInit" class=
"attributes">
<dt><dfn><code>networkId</code></dfn> of type <span class=
"idlAttrType"><a>DOMString</a></span></dt>
<dd>
An ID of the network interface for use in gathering
options. It needs to be unique enough to fulfill that
purpose, but otherwise the value is not significant.
</dd>
<dt><dfn><code>networkInfo</code></dfn> of type <span class=
"idlAttrType"><a>NetworkInformation</a></span></dt>
<dd>
Information about the network interface.
</dd>
</dl>
</section>
</div>
</section>
<section id="rtcicecandidatepairint*">
<h3>Interface Definition</h3>
<div>
<pre class="idl">[Exposed=Window]
partial interface RTCIceCandidatePairInt {
void setMinCheckInterval(double seconds);
void setFrozen(boolean frozen);
void select();
Promise<bool> nominate();
Promise waitForReceiveTimeout(double seconds);
};</pre>
<section>
<h2>Methods</h2>
<dl data-link-for="RTCIceCandidatePairInt" data-dfn-for="RTCIceCandidatePairInt" class=
"methods">
<dt><dfn><code>setMinCheckInterval</code></dfn></dt>
<dd>
<p>Causes the <code><a>RTCIceTransport</a></code> to send ICE checks using
this candidate pair no more frequently than indicated by
the given interval (given in seconds). The
<code><a>RTCIceTransport</a></code> may always send less frequently than
specified. </p>
<table class="parameters">
<tbody>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Nullable</th>
<th>Optional</th>
<th>Description</th>
</tr>
<tr>
<td class="prmName">seconds</td>
<td class="prmType"><code><a>double</a></code></td>
<td class="prmNullFalse"><span role="img" aria-label=
"False">&#10008;</span></td>
<td class="prmOptTrue"><span role="img" aria-label=
"False">&#10008;</span></td>
<td class="prmDesc"></td>
</tr>
</tbody>
</table>
<div>
<em>Return type:</em> <code>void</code>
</div>
</dd>
<dt><dfn><code>setFrozen</code></dfn></dt>
<dd>
<p>Freezes or unfreezes the candidate pair. When frozen,
no ICE checks will be sent over it.</p>
<table class="parameters">
<tbody>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Nullable</th>
<th>Optional</th>
<th>Description</th>
</tr>
<tr>
<td class="prmName">frozen</td>
<td class="prmType"><code><a>boolean</a></code></td>
<td class="prmNullFalse"><span role="img" aria-label=
"False">&#10008;</span></td>
<td class="prmOptTrue"><span role="img" aria-label=
"False">&#10008;</span></td>
<td class="prmDesc"></td>
</tr>
</tbody>
</table>
<div>
<em>Return type:</em> <code>void</code>
</div>
</dd>
<dt><dfn><code>select</code></dfn></dt>
<dd>
<p>Selects the candidate pair. Once this is called
once, the <code><a>RTCIceTransport</a></code>
will no longer automatically select candidate
pairs and the only way to change the selected
candidate pair will be calling select() again
will change the selected candidate pair again.</p>
<div>
<em>Return type:</em> <code>void</code>
</div>
</dd>
<dt><dfn><code>nominate</code></dfn></dt>
<dd>
<p>Nominates the candidate pair by sending a nomination
to the remote side. Resolves the returned promise once
the nomination has been sent or once it has been
determined that it is impossible to nominate (for
example, if aggressive nomination and renomination are
both unavailable due to the ICE options and a nomination
has already been sent.</p>
<div>
<em>Return type:</em> <code>Promise&lt;boolean&gt;</code>
</div>
</dd>
<dt><dfn><code>waitForReceiveTimeout</code></dfn></dt>
<dd>
<p>Wait until no network pacekts have been received for
more than the given timeout. This allows the detection
of network outage. If called a second time on the same
<code><a>RTCIceTransport</a></code>, the previous
call's promise is rejected immediately. Thus only
one pending wait per <code><a>RTCIceTransport</a></code>
is allowed at a time.</p>
<table class="parameters">
<tbody>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Nullable</th>
<th>Optional</th>
<th>Description</th>
</tr>
<tr>
<td class="prmName">seconds</td>
<td class="prmType"><code><a>double</a></code></td>
<td class="prmNullFalse"><span role="img" aria-label=
"False">&#10008;</span></td>
<td class="prmOptTrue"><span role="img" aria-label=
"False">&#10008;</span></td>
<td class="prmDesc"></td>
</tr>
</tbody>
</table>
<div>
<em>Return type:</em> <code>void</code>
</div>
</dd>
</dl>
</section>
</div>
</section>
<section id="rtcicecheck-interface-definition*">
<h3>Interface Definition</h3>
<div>
<pre class="idl">[Exposed=Window]
interface RTCIceCheck {
readonly attribute Promise<boolean> response;
};</pre>
<section>
<h2>Attributes</h2>
<dl data-link-for="RTCIceCheck" data-dfn-for="RTCIceCheck" class=
"attributes">
<dt><dfn><code>response</code></dfn> of type <span class=
"idlAttrType"><a>boolean</a></span></dt>
<dd>
<p>A promise that resolves when the
<code><a>RTCIceTransport</a></code>
receives a response to the check. Resolves with a true
value if the response is successful and false if the
response was an error.</p>
</dd>
</dl>
</section>
</div>
Expand Down Expand Up @@ -580,6 +855,12 @@ <h2>Event summary</h2>
<td>A new <code><a>RTCIceCandidate</a></code> is made available to the
script.</td>
</tr>
<tr>
<td><code>icecheck</code></td>
<td><code><a>RTCIceCheckEvent</a></code></td>
<td>A new <code><a>RTCIceCheck</a></code> is made available to the
script.</td>
</tr>
</tbody>
</table>
</section>
Expand All @@ -595,7 +876,7 @@ <h2>Change Log</h2>
<section class="appendix">
<h2>Acknowledgements</h2>
<p>The editors wish to thank the Working Group chairs and Team Contact,
Harald Alvestrand, Stefan H&aring;kansson, Bernard Aboba and Dominique
Harald Alvestrand, Jan-Ivar Bruaroey, Stefan H&aring;kansson and Dominique
Haza&euml;l-Massieux, for their support. Contributions to this
specification were provided by Robin Raymond.</p>
<p>The <code><a>RTCIceTransport</a></code> object
Expand Down