diff --git a/webrtc.html b/webrtc.html index 8778423cf..e2594789f 100644 --- a/webrtc.html +++ b/webrtc.html @@ -3976,11 +3976,6 @@
If any implementation-specific negotiation is required, as
described at the start of this section, return true
.
If the [[RTCWEB-IP-HANDLING]] mode has been altered since the
- last time this algorithm has been invoked, return
- true
.
Let description be @@ -10978,7 +10973,18 @@
partial interface RTCPeerConnection { static void registerDirectConnectionInterest (); + attribute EventHandler onconnectionupgradable; };+
onconnectionupgradable
of type
+ EventHandlerconnectionupgradable
.RTCPeerConnection
.true
, then abort these steps."connected"
, then update the
-negotiation-needed flag for connection.connectionupgradable
at connection and abort these steps.RTCPeerConnection
.The following mechanism can be used for applications that want to establish a connection as soon as possible, albeit potentially not as direct as possible. In this example, the application tries to upgrade as soon as a connection has been established that is not considered ideal (or the connection could not be established).
-pc.onnegotiationneeded = async () => { - // Exchange new offer/answer via the signalling channel... +pc.onconnectionupgradable = async () => { + // Initiate an ICE restart + const offer = await pc.createOffer({iceRestart: true}); + + // Exchange offer/answer via the signalling channel... }; pc.onconnectionstatechange = async () => { @@ -11045,7 +11054,7 @@Upgrade connection
// Check if requesting a direct connection would be useful const pair = iceTransport.getSelectedCandidatePair(); if (pair.local.type !== 'host') { - // Once granted, this will fire the 'negotiationneeded' event + // Once granted, this will fire the 'connectionupgradable' event RTCPeerConnection.registerDirectConnectionInterest(); } } @@ -11059,8 +11068,11 @@Joining a session
Voice and video chats usually have the concept of a room that is being joined. When a user joins such a room, the permission could be requested which would provide sufficient context to the user.
-pc.onnegotiationneeded = async () => { - // Exchange new offer/answer via the signalling channel... +pc.onconnectionupgradable = async () => { + // Initiate an ICE restart + const offer = await pc.createOffer({iceRestart: true}); + + // Exchange offer/answer via the signalling channel... }; async function joinRoom() { @@ -11072,7 +11084,7 @@Joining a session
console.error(err); } - // Once granted, this will fire the 'negotiationneeded' event if needed + // Once granted, this will fire the 'connectionupgradable' event if needed RTCPeerConnection.registerDirectConnectionInterest(); // Now, create the peer-to-peer connection @@ -11085,12 +11097,15 @@Sending a file
A file sharing application will eventually have to let the user choose a file to be transmitted. Once that selection has been made, requesting a direct connection should provide sufficient context to the user.
-pc.onnegotiationneeded = async () => { - // Exchange new offer/answer via the signalling channel... +pc.onconnectionupgradable = async () => { + // Initiate an ICE restart + const offer = await pc.createOffer({iceRestart: true}); + + // Exchange offer/answer via the signalling channel... }; async function onFileSelected(file) { - // Once granted, this will fire the 'negotiationneeded' event if needed + // Once granted, this will fire the 'connectionupgradable' event if needed RTCPeerConnection.registerDirectConnectionInterest(); // Now, create the peer-to-peer connection @@ -12155,6 +12170,12 @@Event summary
A new + +RTCStatsEvent
is dispatched to the script in response to one or more monitored objects being deleted at the same time.+ + connectionupgradable
+ Event
The [[RTCWEB-IP-HANDLING]] mode for the +RTCPeerConnection
has been upgraded. The application needs to do an ICE restart if it wants to upgrade its connection to be potentially more direct.The following events fire on
RTCDTMFSender