Class RTCPeerConnection
Represents a WebRTC connection between the local peer and remote peer.
Implements
Inherited Members
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 |
|---|---|
| ConnectionState | The readonly property of the RTCPeerConnection indicates the current state of the peer connection by returning one of the RTCPeerConnectionState enum. |
| CurrentLocalDescription | |
| CurrentRemoteDescription | |
| IceConnectionState | The readonly property of the RTCPeerConnection indicates the current state of the peer connection by returning one of the RTCIceConnectionState enum. |
| LocalDescription | |
| OnDataChannel | |
| OnIceCandidate | |
| OnIceConnectionChange | This property is delegate to be called when the IceConnectionState is changed. |
| 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(ref RTCIceCandidate) | |
| AddTrack(MediaStreamTrack, MediaStream) | |
| AddTransceiver(MediaStreamTrack) | |
| AddTransceiver(TrackKind) | |
| Close() | |
| CreateAnswer(ref RTCAnswerOptions) | Create an SDP (Session Description Protocol) answer to start a new connection to a remote peer. |
| CreateDataChannel(string, ref RTCDataChannelInit) | Creates a new data channel related the remote peer. |
| CreateOffer(ref RTCOfferOptions) | 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) | |
| 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(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. |