Class RTCPeerConnection
Represents a WebRTC connection between the local peer and remote peer.
Implements
Namespace: Unity.WebRTC
Assembly: solution.dll
Syntax
public class RTCPeerConnection : IDisposable
Constructors
Name | Description |
---|---|
RTCPeerConnection() | This constructor creates an instance of peer connection with a default configuration. |
RTCPeerConnection(ref RTCConfiguration) | This constructor creates an instance of peer connection with a configuration provided by user. An RTCConfiguration object providing options to configure the new connection. |
Properties
Name | Description |
---|---|
CanTrickleIceCandidates | |
ConnectionState | The readonly property of the RTCPeerConnection indicates the current state of the peer connection by returning one of the RTCPeerConnectionState enum. |
CurrentLocalDescription | |
CurrentRemoteDescription | |
GatheringState | |
IceConnectionState | The readonly property of the RTCPeerConnection indicates the current state of the peer connection by returning one of the RTCIceConnectionState enum. |
LocalDescription | |
OnConnectionStateChange | |
OnDataChannel | |
OnIceCandidate | |
OnIceConnectionChange | This property is delegate to be called when the IceConnectionState is changed. |
OnIceGatheringStateChange | |
OnNegotiationNeeded | |
OnTrack | |
PendingLocalDescription | |
PendingRemoteDescription | |
RemoteDescription | |
SignalingState | The readonly property of the RTCPeerConnection indicates the current state of the peer connection by returning one of the RTCSignalingState enum. |
Methods
Name | Description |
---|---|
AddIceCandidate(RTCIceCandidate) | |
AddTrack(MediaStreamTrack, MediaStream) | |
AddTransceiver(MediaStreamTrack, RTCRtpTransceiverInit) | |
AddTransceiver(TrackKind, RTCRtpTransceiverInit) | |
Close() | |
CreateAnswer() | |
CreateAnswer(ref RTCOfferAnswerOptions) | Create an SDP (Session Description Protocol) answer to start a new connection to a remote peer. |
CreateDataChannel(string, RTCDataChannelInit) | Creates a new data channel related the remote peer. |
CreateOffer() | |
CreateOffer(ref RTCOfferAnswerOptions) | Create an SDP (Session Description Protocol) offer to start a new connection to a remote peer. |
Dispose() | |
~RTCPeerConnection() | |
GetConfiguration() | Returns an object which indicates the current configuration of the RTCPeerConnection. |
GetReceivers() | Returns array of objects each of which represents one RTP receiver. |
GetSenders() | Returns array of objects each of which represents one RTP sender. |
GetStats() | Returns an AsyncOperation which resolves with data providing statistics. |
GetTransceivers() | Returns array of objects each of which represents one RTP transceiver. |
RemoveTrack(RTCRtpSender) | |
RestartIce() | |
SetConfiguration(ref RTCConfiguration) | This method sets the current configuration of the RTCPeerConnection This lets you change the ICE servers used by the connection and which transport policies to use. |
SetLocalDescription() | |
SetLocalDescription(ref RTCSessionDescription) | This method changes the session description of the local connection to negotiate with other connections. |
SetRemoteDescription(ref RTCSessionDescription) | This method changes the session description of the remote connection to negotiate with local connections. |