diff --git a/webrtc.html b/webrtc.html index 06ee013cb..c54e93196 100644 --- a/webrtc.html +++ b/webrtc.html @@ -8139,10 +8139,14 @@

RTCIceTransport Interface

-

When the [= ICE Agent =] indicates that the - {{RTCIceTransportState}} for an - {{RTCIceTransport}} has changed, the user agent MUST queue - a task that runs the following steps:

+

The {{RTCIceTransportState}} of an {{RTCIceTransport}} may change + because a candidate pair with a usable connection was found and selected + or it may change without the selected candidate pair changing. The + selected pair and {{RTCIceTransportState}} are related and are handled in + the same task.

+

When the [= ICE Agent =] indicates that an {{RTCIceTransport}} has + changed either the selected candidate pair, the {{RTCIceTransportState}} or + both, the user agent MUST queue a task that runs the following steps:

  1. Let connection be the @@ -8158,79 +8162,94 @@

    RTCIceTransport Interface

    whose state is changing.

  2. -

    Set transport.[[\IceTransportState]] to the new - indicated {{RTCIceTransportState}}.

    +

    Let selectedCandidatePairChanged be + false.

  3. -

    Set connection's [= ICE connection state =] to the - value of deriving a new state value as described by the - {{RTCIceConnectionState}} enum.

    +

    Let transportIceConnectionStateChanged be + false.

  4. -

    Let iceConnectionStateChanged be true if - the ice connection state changed in the previous step, - otherwise false.

    +

    Let connectionIceConnectionStateChanged be + false.

  5. -

    Set connection's [= connection state =] to the value of - deriving a new state value as described by the - {{RTCPeerConnectionState}} enum.

    +

    Let connectionStateChanged be false.

  6. -

    Let connectionStateChanged be true if - the [= connection state =] changed in the previous step, otherwise - false.

    +

    If transport's selected candidate pair was changed, run + the following steps:

    +
      +
    1. +

      Let newCandidatePair be a newly created + {{RTCIceCandidatePair}} representing the indicated pair if one is + selected, and null otherwise.

      +
    2. +
    3. +

      Set transport.[[\SelectedCandidatePair]] + to newCandidatePair.

      +
    4. +
    5. +

      Set selectedCandidatePairChanged to + true.

      +
    6. +
    +
  7. +
  8. +

    If transport's {{RTCIceTransportState}} was changed, run + the following steps:

    +
      +
    1. +

      Set transport.[[\IceTransportState]] to the + new indicated {{RTCIceTransportState}}.

      +
    2. +
    3. +

      Set transportIceConnectionStateChanged to + true.

      +
    4. +
    5. +

      Set connection's [= ICE connection state =] to the + value of deriving a new state value as described by the + {{RTCIceConnectionState}} enum.

      +
    6. +
    7. +

      If the ice connection state changed in the previous + step, set connectionIceConnectionStateChanged to + true.

      +
    8. +
    9. +

      Set connection's [= connection state =] to the value + of deriving a new state value as described by the + {{RTCPeerConnectionState}} enum.

      +
    10. +
    11. +

      If the [= connection state =] changed in the previous step, set + connectionStateChanged to true.

      +
    12. +
  9. -

    [= Fire an event =] named {{statechange}} at +

    If selectedCandidatePairChanged is true, + [= fire an event =] named {{selectedcandidatepairchange}} at + transport.

    +
  10. +
  11. +

    If transportIceConnectionStateChanged is + true, [= fire an event =] named {{statechange}} at transport.

  12. -

    If iceConnectionStateChanged is true, - [= fire an event =] named - {{iceconnectionstatechange}} at - connection.

    +

    If connectionIceConnectionStateChanged is + true, [= fire an event =] named + {{iceconnectionstatechange}} at connection.

  13. If connectionStateChanged is true, - [= fire an event =] named - {{connectionstatechange}} at + [= fire an event =] named {{connectionstatechange}} at connection.

-

When the [= ICE Agent =] indicates that the selected candidate pair - for an {{RTCIceTransport}} has changed, the user agent - MUST queue a task that runs the following steps:

-
    -
  1. -

    Let connection be the - {{RTCPeerConnection}} object associated with this - [= ICE Agent =].

    -
  2. -
  3. -

    If connection.[[\IsClosed]] is - true, abort these steps.

    -
  4. -
  5. -

    Let transport be the {{RTCIceTransport}} - whose selected candidate pair is changing.

    -
  6. -
  7. -

    Let newCandidatePair be a newly created - {{RTCIceCandidatePair}} representing the indicated - pair if one is selected, and null otherwise.

    -
  8. -
  9. -

    Set transport.[[\SelectedCandidatePair]] - to newCandidatePair.

    -
  10. -
  11. -

    [= Fire an event =] named - {{selectedcandidatepairchange}} at - transport.

    -
  12. -

An {{RTCIceTransport}} object has the following internal slots: