Add an ice candidate generated by a remote peer (and received over the signaling server). See iceCandidateCreated.
Close the peer connection and all data channels associated with it. Note, you cannot reuse this object for a new connection unless you call initialize.
Returns a new WebRTCDataChannel (or null on failure) with given label and optionally configured via the options dictionary. This method can only be called when the connection is in state constant STATE_NEW. There are two ways to create a working data channel: either call createDataChannel on only one of the peer and listen to dataChannelReceived on the other, or call createDataChannel on both peers, with the same values, and the negotiated option set to true. Valid options are:
Creates a new SDP offer to start a WebRTC connection with a remote peer. At least one WebRTCDataChannel must have been created before calling this method. If this functions returns constant OK, sessionDescriptionCreated will be called when the session is ready to be sent.
Returns the connection state. See connectionstate.
Re-initialize this peer connection, closing any previously active connection, and going back to state constant STATE_NEW. A dictionary of options can be passed to configure the peer connection. Valid options are:
Call this method frequently (e.g. in Node._process or Node._physicsProcess) to properly receive signals.
Sets the SDP description of the local peer. This should be called in response to sessionDescriptionCreated. After calling this function the peer will start emitting iceCandidateCreated (unless an error different from constant OK is returned).
Sets the SDP description of the remote peer. This should be called with the values generated by a remote peer and received over the signaling server. If type is offer the peer will emit sessionDescriptionCreated with the appropriate answer. If type is answer the peer will start emitting iceCandidateCreated.
Construct a new instance of WebRTCPeerConnection. Note: use memnew!WebRTCPeerConnection instead.
Interface to a WebRTC peer connection.
A WebRTC connection between the local computer and a remote peer. Provides an interface to connect, maintain and monitor the connection. Setting up a WebRTC connection between two peers from now on) may not seem a trivial task, but it can be broken down into 3 main steps: - The peer that wants to initiate the connection (A from now on) creates an offer and send it to the other peer (B from now on). - B receives the offer, generate and answer, and sends it to A). - A and B then generates and exchange ICE candidates with each other. After these steps, the connection should become connected. Keep on reading or look into the tutorial for more information.