Search completed in 1.07 seconds.
14 results for "connectionstatechange":
RTCPeerConnection: iceconnectionstatechange event - Web APIs
an ice
connectionstatechange event is sent to an rtcpeerconnection object each time the ice connection state changes during the negotiation process.
... bubbles no cancelable no interface event event handler property onice
connectionstatechange one common task performed by the ice
connectionstatechange event listener: to trigger ice restart when the state changes to failed.
... examples an event handler for this event can be added using the rtcpeerconnection.onice
connectionstatechange property or by using addeventlistener() on the rtcpeerconnection.
...And 2 more matches
RTCPeerConnection: connectionstatechange event - Web APIs
the
connectionstatechange event is sent to the ontrack event handler on an rtcpeerconnection object after a new track has been added to an rtcrtpreceiver which is part of the connection.
... bubbles no cancelable no interface event event handler on
connectionstatechange examples for an rtcpeerconnection, pc, this example sets up a handler for
connectionstatechange messages to handle changes to the connectivity of the webrtc session.
... pc.on
connectionstatechange = ev => { switch(pc.connectionstate) { case "new": case "checking": setonlinestatus("connecting..."); break; case "connected": setonlinestatus("online"); break; case "disconnected": setonlinestatus("disconnecting..."); break; case "closed": setonlinestatus("offline"); break; case "failed": setonlinestatus("error"); break; default: setonlinestatus("unknown"); break; } } you can also create a handler for
connectionstatechange by using addeventlistener(): pc.addeventlistener("
connectionstatechange", ev => { switch(pc.connectionstate) { /* ...
... */ } }, false); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of '
connectionstatechange' in that specification.
RTCPeerConnection.oniceconnectionstatechange - Web APIs
the rtcpeerconnection.onice
connectionstatechange property is an event handler which specifies a function to be called when the ice
connectionstatechange event is fired on an rtcpeerconnection instance.
... syntax rtcpeerconnection.onice
connectionstatechange = eventhandler; value this event handler can be set to function which is passed a single input parameter: an event object describing the ice
connectionstatechange event which occurred.
... pc.onice
connectionstatechange = function(event) { if (pc.iceconnectionstate === "failed" || pc.iceconnectionstate === "disconnected" || pc.iceconnectionstate === "closed") { // handle the failure } }; of course, "disconnected" and "closed" don't necessarily indicate errors; these can be the result of normal ice negotiation, so be sure to handle these properly (if at all).
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.onice
connectionstatechange' in that specification.
RTCPeerConnection.onconnectionstatechange - Web APIs
the rtcpeerconnection.on
connectionstatechange property specifies an eventhandler which is called to handle the
connectionstatechange event when it occurs on an instance of rtcpeerconnection.
... syntax rtcpeerconnection.on
connectionstatechange = eventhandler; value a function which is called by the browser when the
connectionstatechange event occurs on the rtcpeerconnection.
... example pc.on
connectionstatechange = function(event) { switch(pc.connectionstate) { case "connected": // the connection has become fully connected break; case "disconnected": case "failed": // one or more transports has terminated unexpectedly or in an error break; case "closed": // the connection has been closed break; } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.onconnectionstatec...
RTCPeerConnection - Web APIs
the event is sent immediately after the call setremotedescription() and doesn't wait for the result of the sdp negotiation.on
connectionstatechangethe rtcpeerconnection.on
connectionstatechange property specifies an eventhandler which is called to handle the
connectionstatechange event when it occurs on an instance of rtcpeerconnection.
...this happens whenever the local ice agent needs to deliver a message to the other peer through the signaling server.onice
connectionstatechange the rtcpeerconnection.onice
connectionstatechange property is an event handler which specifies a function to be called when the ice
connectionstatechange event is fired on an rtcpeerconnection instance.
...
connectionstatechange sent to the rtcpeerconnection object when the overall connectivity status of the rtcpeerconnection changes.
...And 3 more matches
Signaling and video calling - Web APIs
{ urls: "stun:stun.stunprotocol.org" } ] }); mypeerconnection.onicecandidate = handleicecandidateevent; mypeerconnection.ontrack = handletrackevent; mypeerconnection.onnegotiationneeded = handlenegotiationneededevent; mypeerconnection.onremovetrack = handleremovetrackevent; mypeerconnection.onice
connectionstatechange = handleice
connectionstatechangeevent; mypeerconnection.onicegatheringstatechange = handleicegatheringstatechangeevent; mypeerconnection.onsignalingstatechange = handlesignalingstatechangeevent; } when using the rtcpeerconnection() constructor, we will specify an rtcconfiguration-compliant object providing configuration parameters for the connection.
... rtcpeerconnection.onice
connectionstatechange the ice
connectionstatechange event is sent by the ice layer to let you know about changes to the state of the ice connection.
...e rtcpeerconnection object: function closevideocall() { var remotevideo = document.getelementbyid("received_video"); var localvideo = document.getelementbyid("local_video"); if (mypeerconnection) { mypeerconnection.ontrack = null; mypeerconnection.onremovetrack = null; mypeerconnection.onremovestream = null; mypeerconnection.onicecandidate = null; mypeerconnection.onice
connectionstatechange = null; mypeerconnection.onsignalingstatechange = null; mypeerconnection.onicegatheringstatechange = null; mypeerconnection.onnegotiationneeded = null; if (remotevideo.srcobject) { remotevideo.srcobject.gettracks().foreach(track => track.stop()); } if (localvideo.srcobject) { localvideo.srcobject.gettracks().foreach(track => track.stop()); } mypeerco...
...And 3 more matches
Index - Web APIs
3434 rtcpeerconnection.on
connectionstatechange api, connection state, event handler, ice, property, rtcpeerconnection, reference, webrtc, on
connectionstatechange the rtcpeerconnection.on
connectionstatechange property specifies an eventhandler which is called to handle the
connectionstatechange event when it occurs on an instance of rtcpeerconnection.
... 3438 rtcpeerconnection.onice
connectionstatechange event handler, experimental, property, rtcpeerconnection, reference, webrtc, onice
connectionstatechange the rtcpeerconnection.onice
connectionstatechange property is an event handler which specifies a function to be called when the ice
connectionstatechange event is fired on an rtcpeerconnection instance.
... 3462 rtcpeerconnection:
connectionstatechange event the
connectionstatechange event is sent to the ontrack event handler on an rtcpeerconnection object after a new track has been added to an rtcrtpreceiver which is part of the connection.
... 3465 rtcpeerconnection: ice
connectionstatechange event api, connection, connectivity, disconnect, ice, media, rtcpeerconnection, reference, webrtc, webrtc api, events, iceconnectionstate, ice
connectionstatechange an ice
connectionstatechange event is sent to an rtcpeerconnection object each time the ice connection state changes during the negotiation process.
Using DTMF with WebRTC - Web APIs
function connectanddial() { callerpc = new rtcpeerconnection(); hasaddtrack = (callerpc.addtrack !== undefined); callerpc.onicecandidate = handlecallericeevent; callerpc.onnegotiationneeded = handlecallernegotiationneeded; callerpc.onice
connectionstatechange = handlecallerice
connectionstatechange; callerpc.onsignalingstatechange = handlecallersignalingstatechangeevent; callerpc.onicegatheringstatechange = handlecallergatheringstatechangeevent; receiverpc = new rtcpeerconnection(); receiverpc.onicecandidate = handlereceivericeevent; if (hasaddtrack) { receiverpc.ontrack = handlereceivertrackevent; } else { receiverpc.onaddstream ...
...to accomplish that, we watch for the caller to receive an ice
connectionstatechange event.
... function handlecallerice
connectionstatechange() { log("caller's connection state changed to " + callerpc.iceconnectionstate); if (callerpc.iceconnectionstate === "connected") { log("sending dtmf: \"" + dialstring + "\""); dtmfsender.insertdtmf(dialstring, 400, 50); } } the ice
connectionstatechange event doesn't actually include within it the new state, so we get the connection process's current state from callerpc's rtcpeerconnection.iceconnectionstate property.
RTCOfferOptions.iceRestart - Web APIs
fundamentally, this renegotiation is triggered by generating and using new values for the ice username fragment ("ufrag")}} example this example shows a handler for the ice
connectionstatechange event.
... pc.onice
connectionstatechange = function(evt) { if (pc.iceconnectionstate === "failed") { if (pc.restartice) { pc.restartice(); } else { pc.createoffer({ icerestart: true }) .then(pc.setlocaldescription) .then(sendoffertoserver); } } } if the state changes to failed, this handler starts by looking to see if the rtcpeerconnection includes the restartice() method; if it does, we call that to request an ice restart.
RTCPeerConnection.restartIce() - Web APIs
example this example creates a handler for the ice
connectionstatechange event that handles a transition to the failed state by restarting ice in order to try again.
... pc.addeventlistener("ice
connectionstatechange", event => { if (pc.iceconnectionstate === "failed") { /* possibly reconfigure the connection in some way here */ /* then request ice restart */ pc.restartice(); } }); with this code in place, a transition to the failed state during ice negotiation will cause a negotiationneeded event to be fired, in response to which your code should renegotiate as usual.
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
the old way in the past, if you encountered an ice error and needed to restart negotiation, you might have done something like this: pc.onnegotiationneeded = async options => { await pc.setlocaldescription(await pc.createoffer(options)); signaler.send({ description: pc.localdescription }); }; pc.onice
connectionstatechange = () => { if (pc.iceconnectionstate === "failed") { pc.onnegotiationneeded({ icerestart: true }); } }; this has a number of reliability issues and outright bugs (such as failing if the ice
connectionstatechange event fires when the signaling state isn't stable), but there was no way you could actually request an ice restart other than by creating and sending an offer with the icerestart ...
... using restartice() now, you can use restartice() to do this much more cleanly: pc.onnegotiationneeded = async options => { await pc.setlocaldescription(await pc.createoffer(options)); signaler.send({ description: pc.localdescription }); }; pc.onice
connectionstatechange = () => { if (pc.iceconnectionstate === "failed") { pc.restartice(); } }; with this improved technique, instead of directly calling onnegotiationneeded with options to trigger ice restart, the failed ice connection state simply calls restartice().
WebRTC API - Web APIs
connectionstatechange the connection's state, which can be accessed in connectionstate, has changed.
... ice
connectionstatechange sent to an rtcpeerconnection when its ice connection's state—found in the iceconnectionstate property—changes.