diff --git a/webrtc.html b/webrtc.html index 06ee013cb..c54e93196 100644 --- a/webrtc.html +++ b/webrtc.html @@ -8139,10 +8139,14 @@
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:
Let connection be the @@ -8158,79 +8162,94 @@
Set transport.[[\IceTransportState]] to the new - indicated {{RTCIceTransportState}}.
+Let selectedCandidatePairChanged be
+ false
.
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
.
Let iceConnectionStateChanged be true
if
- the ice connection state changed in the previous step,
- otherwise false
.
Let connectionIceConnectionStateChanged be
+ false
.
Set connection's [= connection state =] to the value of - deriving a new state value as described by the - {{RTCPeerConnectionState}} enum.
+Let connectionStateChanged be false
.
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:
+Let newCandidatePair be a newly created
+ {{RTCIceCandidatePair}} representing the indicated pair if one is
+ selected, and null
otherwise.
Set transport.[[\SelectedCandidatePair]] + to newCandidatePair.
+Set selectedCandidatePairChanged to
+ true
.
If transport's {{RTCIceTransportState}} was changed, run + the following steps:
+Set transport.[[\IceTransportState]] to the + new indicated {{RTCIceTransportState}}.
+Set transportIceConnectionStateChanged to
+ true
.
Set connection's [= ICE connection state =] to the + value of deriving a new state value as described by the + {{RTCIceConnectionState}} enum.
+If the ice connection state changed in the previous
+ step, set connectionIceConnectionStateChanged to
+ true
.
Set connection's [= connection state =] to the value + of deriving a new state value as described by the + {{RTCPeerConnectionState}} enum.
+If the [= connection state =] changed in the previous step, set
+ connectionStateChanged to true
.
[= Fire an event =] named {{statechange}} at +
If selectedCandidatePairChanged is true
,
+ [= fire an event =] named {{selectedcandidatepairchange}} at
+ transport.
If transportIceConnectionStateChanged is
+ true
, [= fire an event =] named {{statechange}} at
transport.
If iceConnectionStateChanged is true
,
- [= fire an event =] named
- {{iceconnectionstatechange}} at
- connection.
If connectionIceConnectionStateChanged is
+ true
, [= fire an event =] named
+ {{iceconnectionstatechange}} at connection.
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:
-Let connection be the - {{RTCPeerConnection}} object associated with this - [= ICE Agent =].
-If connection.[[\IsClosed]] is
- true
, abort these steps.
Let transport be the {{RTCIceTransport}} - whose selected candidate pair is changing.
-Let newCandidatePair be a newly created
- {{RTCIceCandidatePair}} representing the indicated
- pair if one is selected, and null
otherwise.
Set transport.[[\SelectedCandidatePair]] - to newCandidatePair.
-[= Fire an event =] named - {{selectedcandidatepairchange}} at - transport.
-An {{RTCIceTransport}} object has the following internal slots: