diff --git a/index.html b/index.html index 5435267..752c2dd 100644 --- a/index.html +++ b/index.html @@ -74,6 +74,10 @@

Terminology

The terms [= event =], [= event handlers =] and [= event handler event types =] are defined in [[!HTML]].

+

+ The process of nominating a candidate pair is defined in + [[RFC8445]] Section 8.1.1. +

@@ -687,7 +691,7 @@

{{RTCRtpSender}} {{RTCRtpSender/setParameters()}} modifications to existing @@ -705,7 +709,138 @@

application to observe and affect certain actions that an ICE agent [[RFC5245]] performs.

- When the [= ICE agent =] has picked a candidate pair to remove, the [= user agent =] MUST [= queue a task =] to remove a candidate pair: + The [= ICE agent =] performs connectivity checks to identify valid candidate pairs on which it is possible to send + and receive media and data. In order to conclude ICE processing, the [= ICE agent =] {{nominates}} a valid candidate + pair as the selected candidate pair. Prior to nomination, any valid candidate pair may be used to send and receive data. + Once + a candidate pair is nominated successfully, only the selected candidate pair will be used to send and receive data. + Changing + the selected candidate pair after a successful nomination requires an ICE restart. +

+

+ When the [= ICE agent =] has picked a candidate pair to {{nominate}} as the selected candidate pair, the [= user + agent =] + MUST [= queue a task =] to nominate a + candidate pair: +

+
    +
  1. +

    + Let |connection:RTCPeerConnection| be the {{RTCPeerConnection}} object associated with this [= ICE agent =]. +

    +
  2. +
  3. +

    + If connection.{{RTCPeerConnection/[[IsClosed]]}} is + true, abort these steps. +

    +
  4. +
  5. +

    + Let |transport:RTCIceTransport| be the {{RTCIceTransport}} object associated with this candidate pair. +

    +
  6. +
  7. +

    + Let |candidatePair:RTCIceCandidatePair| be the candidate pair which is being {{nominated}}. +

    +
  8. +
  9. +

    + Set |transport|.{{RTCIceTransport/[[ProposalPending]]}} to true. +

    +
  10. +
  11. +

    + Let |accepted:boolean| be the result of [= fire an event | firing an event =] named + {{RTCIceTransport/icecandidatepairnominate}} at |transport|, using {{RTCIceCandidatePairEvent}}, with the + {{Event/cancelable}} attribute initialized to true, and the {{RTCIceCandidatePairEvent/local}} and + {{RTCIceCandidatePairEvent/remote}} attributes initialized to the local and remote candidates, respectively, of + |candidatePair|. +

    +
  12. +
  13. +

    + Set |transport|.{{RTCIceTransport/[[ProposalPending]]}} to false. +

    +
  14. +
  15. +

    + If |accepted| is false, instruct the [= ICE agent =] to not {{nominate}} |candidatePair|, and instead to + continue to perform connectivity checks. The [= ICE agent =] may continue to send data using the candidate pair + indicated by |candidatePair| unless instructed to use another candidate pair with + {{RTCIceTransport/setSelectedCandidatePair}}. +

    +
  16. +
  17. +

    + Otherwise, instruct the [= ICE agent =] to {{nominate}} the candidate pair indicated by |candidatePair|. +

    +
  18. +
+

+ If the application defers the {{nomination}} of a candidate pair by cancelling the + {{RTCIceTransport/icecandidatepairnominate}} event, it may select a different candidate pair to send data by calling + {{RTCIceTransport/setSelectedCandidatePair}}. When the method is called, the [= user agent =] MUST run the steps to change the selected candidate pair: +

+
    +
  1. +

    + Let |connection:RTCPeerConnection| be the {{RTCPeerConnection}} object associated with this [= ICE agent =]. +

    +
  2. +
  3. +

    + If connection.{{RTCPeerConnection/[[IsClosed]]}} is + true, [= exception/throw =] an {{InvalidStateError}}. +

    +
  4. +
  5. +

    + Let |transport:RTCIceTransport| be the {{RTCIceTransport}} object associated with this candidate pair. +

    +
  6. +
  7. +

    + If |transport|.{{RTCIceTransport/[[ProposalPending]]}} is true, [= exception/throw =] an {{InvalidStateError}}. +

    +
  8. +
  9. +

    + If |transport|.{{RTCIceTransport/[[IceTransportState]]}} is either of + {{RTCIceTransportState/"new"}}, {{RTCIceTransportState/"failed"}} or {{RTCIceTransportState/"closed"}}, [= + exception/throw =] + an {{InvalidStateError}}. +

    +
  10. +
  11. +

    + Let |candidatePair:RTCIceCandidatePair| be the candidate pair which is being set as the selected candidate pair. +

    +
  12. +
  13. +

    + If |candidatePair| does not describe a candidate pair formed for this {{RTCIceTransport}} and sent in + {{RTCIceTransport/onicecandidatepairadd}}, [= exception/throw =] a {{NotFoundError}}. +

    +
  14. +
  15. +

    + Instruct the [= ICE agent =] to use |candidatePair| to send data, and continue to the steps for a change in the selected + candidate pair (leading up to {{RTCIceTransport/onselectedcandidatepairchange}}). +

    +
  16. +
+

+ After changing the selected candidate pair, the controlling [= ICE agent =] may attempt to [= nominate the candidate + pair =] as + well to conclude ICE processing. The application may cancel the nomination to allow further changes to the selected + candidate pair. +

+

+ When the [= ICE agent =] has picked a candidate pair to remove, the [= user agent =] MUST [= queue a task =] to remove a candidate pair:

  1. @@ -731,19 +866,34 @@

  2. - Let |cancelable:boolean| be true if the candidate pair is being removed in order to free an unused candidate, and false otherwise. + Let |cancelable:boolean| be true if the candidate pair is being removed in order to free an unused candidate, and + false otherwise. +

    +
  3. +
  4. +

    + Set |transport|.{{RTCIceTransport/[[ProposalPending]]}} to true.

  5. Let |accepted:boolean| be the result of [= fire an event | firing an event =] named {{RTCIceTransport/icecandidatepairremove}} at |transport|, using {{RTCIceCandidatePairEvent}}, with the - {{Event/cancelable}} attribute initialized to cancelable, and the {{RTCIceCandidatePairEvent/local}} and {{RTCIceCandidatePairEvent/remote}} attributes initialized to the local and remote candidates, respectively, of |candidatePair|. + {{Event/cancelable}} attribute initialized to cancelable, and the {{RTCIceCandidatePairEvent/local}} + and {{RTCIceCandidatePairEvent/remote}} attributes initialized to the local and remote candidates, respectively, + of |candidatePair|. +

    +
  6. +
  7. +

    + Set |transport|.{{RTCIceTransport/[[ProposalPending]]}} to false.

  8. - If |accepted| is false, instruct the [= ICE agent =] to not remove the candidate pair indicated by |candidatePair|, and instead continue to send and respond to ICE connectivity checks on the candidate pair as before. + If |accepted| is false, instruct the [= ICE agent =] to not remove the candidate pair indicated by + |candidatePair|, and instead continue to send and respond to ICE connectivity checks on the candidate pair as + before.

  9. @@ -752,12 +902,22 @@

+

+ The {{RTCIceTransport}} object is extended by adding the following internal slot: +

+
-      partial interface RTCIceTransport {
-        attribute EventHandler onicecandidatepairadd;
-        attribute EventHandler onicecandidatepairremove;
-      };
-
+ partial interface RTCIceTransport { + attribute EventHandler onicecandidatepairadd; + attribute EventHandler onicecandidatepairremove; + attribute EventHandler onicecandidatepairnominate; + undefined setSelectedCandidatePair(RTCIceCandidatePair candidatePair); + }; +

Attributes

@@ -770,7 +930,8 @@

Attributes

When the [= ICE agent =] has formed a candidate pair, the [= user agent =] MUST queue a task to [= fire an event =] named {{icecandidatepairadd}} using the {{RTCIceCandidatePairEvent}} interface, with the - {{RTCIceCandidatePairEvent/local}} and {{RTCIceCandidatePairEvent/remote}} attributes set to the local and remote candidates, respectively, of the formed candidate pair. + {{RTCIceCandidatePairEvent/local}} and {{RTCIceCandidatePairEvent/remote}} attributes set to the local and + remote candidates, respectively, of the formed candidate pair.

@@ -785,6 +946,35 @@

Attributes

the [= user agent =] MUST run the steps to [= remove a candidate pair =].

+
+ onicecandidatepairnominate of type {{EventHandler}} +
+
+

+ The event type of this event handler is {{icecandidatepairnominate}}. +

+

+ When the [= ICE agent =] has picked a candidate pair to {{nominate}} as the selected candidate pair, but + before + the + nomination takes place, the [= user agent =] MUST run the steps to [= nominate a candidate pair =]. +

+
+
+
+
+

Methods

+
+
+ setSelectedCandidatePair +
+
+

+ The {{setSelectedCandidatePair}} method attempts to change the selected candidate pair. If successful, data will be sent + on the provided candidate pair. When this method is invoked, the [= user agent =] MUST run the steps to [= change the + selected candidate pair =]. +

+
@@ -792,23 +982,24 @@

RTCIceCandidatePairEvent

- The {{RTCIceTransport/icecandidatepairadd}} and {{RTCIceTransport/icecandidatepairremove}} events use the {{RTCIceCandidatePairEvent}} interface. + The {{RTCIceTransport/icecandidatepairadd}} and {{RTCIceTransport/icecandidatepairremove}} events use the + {{RTCIceCandidatePairEvent}} interface.

[Exposed=Window]
-interface RTCIceCandidatePairEvent : Event {
-  constructor(DOMString type, RTCIceCandidatePairEventInit eventInitDict);
-  readonly attribute RTCIceCandidate local;
-  readonly attribute RTCIceCandidate remote;
-};
-
+ interface RTCIceCandidatePairEvent : Event { + constructor(DOMString type, RTCIceCandidatePairEventInit eventInitDict); + readonly attribute RTCIceCandidate local; + readonly attribute RTCIceCandidate remote; + }; +

Constructors

RTCIceCandidatePairEvent.constructor()
-
+

Attributes

@@ -816,7 +1007,8 @@

Attributes

- The {{local}} attribute represents the local {{RTCIceCandidate}} of the candidate pair associated with the event. + The {{local}} attribute represents the local {{RTCIceCandidate}} of the candidate pair associated with the + event.

@@ -824,7 +1016,8 @@

Attributes

- The {{remote}} attribute represents the remote {{RTCIceCandidate}} of the candidate pair associated with the event. + The {{remote}} attribute represents the remote {{RTCIceCandidate}} of the candidate pair associated with + the event.

@@ -832,10 +1025,10 @@

Attributes

-dictionary RTCIceCandidatePairEventInit : EventInit {
-  required RTCIceCandidate local;
-  required RTCIceCandidate remote;
-};
+ dictionary RTCIceCandidatePairEventInit : EventInit { + required RTCIceCandidate local; + required RTCIceCandidate remote; + };

Dictionary RTCIceCandidatePairEventInit Members

Event summary

The [= ICE agent =] has picked a candidate pair to remove, and unless the operation is canceled by invoking the preventDefault() method on the event, it will be removed. + + icecandidatepairnominate + {{RTCIceCandidatePairEvent}} + + The [= ICE agent =] has picked a valid candidate pair to {{nominate}}, and unless the operation is canceled by + invoking the preventDefault() method on the event, it will be {{nominated}}. + +