Class ConnectionInfo
Connection information.
Inherited Members
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class ConnectionInfo : Info
Constructors
ConnectionInfo()
Initializes a new instance of the ConnectionInfo class.
Declaration
public ConnectionInfo()
ConnectionInfo(String, String, String, String, String, String, String, Boolean, Boolean, String, String, String, FormatInfo[], FormatInfo[])
Initializes a new instance of the ConnectionInfo class.
Declaration
public ConnectionInfo(string userId, string deviceId, string clientId, string id, string tag, string type, string mediaId, bool localAudioMuted, bool localVideoMuted, string audioDirection, string videoDirection, string dataDirection, FormatInfo[] audioFormats, FormatInfo[] videoFormats)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userId | The user identifier. |
| System.String | deviceId | The device identifier. |
| System.String | clientId | The client identifier. |
| System.String | id | The connection identifier. |
| System.String | tag | The connection tag. |
| System.String | type | The connection type. |
| System.String | mediaId | The media identifier. |
| System.Boolean | localAudioMuted | The audio muted boolean. |
| System.Boolean | localVideoMuted | The video muted boolean. |
| System.String | audioDirection | The audio direction. |
| System.String | videoDirection | The video direction. |
| System.String | dataDirection | The data direction. |
| FormatInfo[] | audioFormats | The audio formats. |
| FormatInfo[] | videoFormats | The video formats. |
ConnectionInfo(String, String, String, String, String, String, String[], String, String, String, String, String, Boolean, Boolean, String, String, String, FormatInfo[], FormatInfo[], String, Nullable<Int32>)
Initializes a new instance of the ConnectionInfo class.
Declaration
public ConnectionInfo(string userId, string userAlias, string deviceId, string deviceAlias, string clientId, string clientTag, string[] clientRoles, string clientProtocol, string id, string tag, string type, string mediaId, bool localAudioMuted, bool localVideoMuted, string audioDirection, string videoDirection, string dataDirection, FormatInfo[] audioFormats, FormatInfo[] videoFormats, string layoutZone, int? layoutPriority)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userId | The user identifier. |
| System.String | userAlias | The user alias. |
| System.String | deviceId | The device identifier. |
| System.String | deviceAlias | The device alias. |
| System.String | clientId | The client identifier. |
| System.String | clientTag | The client tag. |
| System.String[] | clientRoles | The client roles. |
| System.String | clientProtocol | The client protocol. |
| System.String | id | The connection identifier. |
| System.String | tag | The connection tag. |
| System.String | type | The connection type. |
| System.String | mediaId | The media identifier. |
| System.Boolean | localAudioMuted | The audio muted boolean. |
| System.Boolean | localVideoMuted | The video muted boolean. |
| System.String | audioDirection | The audio direction. |
| System.String | videoDirection | The video direction. |
| System.String | dataDirection | The data direction. |
| FormatInfo[] | audioFormats | The audio formats. |
| FormatInfo[] | videoFormats | The video formats. |
| System.String | layoutZone | The layout zone. |
| System.Nullable<System.Int32> | layoutPriority | The layout priority. |
Properties
ApplicationId
Gets or sets the application identifier.
Declaration
public string ApplicationId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
AudioDirection
Gets or sets the audio stream direction.
Declaration
public string AudioDirection { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
AudioFormats
Gets the audio formats, if applicable.
Declaration
public FormatInfo[] AudioFormats { get; }
Property Value
| Type | Description |
|---|---|
| FormatInfo[] |
AudioStream
Gets or sets the first connection audio stream.
Declaration
public MediaStreamInfo AudioStream { get; set; }
Property Value
| Type | Description |
|---|---|
| MediaStreamInfo |
AudioStreams
Gets or sets the connection audio streams.
Declaration
public MediaStreamInfo[] AudioStreams { get; set; }
Property Value
| Type | Description |
|---|---|
| MediaStreamInfo[] |
ChannelId
Gets or sets the channel identifier.
Declaration
public string ChannelId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
ClientId
Gets or sets the client identifier.
Declaration
public string ClientId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
ClientProtocol
Gets or sets the client protocol.
Declaration
public string ClientProtocol { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
ClientRoles
Gets or sets the client roles.
Declaration
public string[] ClientRoles { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String[] |
ClientTag
Gets or sets the client tag.
Declaration
public string ClientTag { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
DataDirection
Gets or sets the data stream direction. Obsolete.
Declaration
public string DataDirection { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
DataStream
Gets or sets the connection data stream.
Declaration
public DataStreamInfo DataStream { get; set; }
Property Value
| Type | Description |
|---|---|
| DataStreamInfo |
DeviceAlias
Gets or sets the device alias.
Declaration
public string DeviceAlias { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
DeviceId
Gets or sets the device identifier.
Declaration
public string DeviceId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Error
Gets or sets the connection error, if an error exists.
Declaration
public Error Error { get; set; }
Property Value
| Type | Description |
|---|---|
| Error |
ExternalId
Gets or sets the connection external identifier.
Declaration
public string ExternalId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
HasAudio
Gets a value indicating whether the connection has an audio stream.
Declaration
public bool HasAudio { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
HasData
Gets a value indicating whether the connection has a data stream.
Declaration
public bool HasData { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
HasVideo
Gets a value indicating whether the connection has a video stream.
Declaration
public bool HasVideo { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsSip
Gets whether the client is connected via SIP.
Declaration
public bool IsSip { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LayoutPriority
Gets or sets the layout priority.
Declaration
public int? LayoutPriority { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Int32> |
LayoutZone
Gets or sets the layout zone.
Declaration
public string LayoutZone { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
LocalAudioDisabled
Gets or sets if local audio is disabled.
Declaration
public bool LocalAudioDisabled { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LocalAudioMuted
Gets whether the local audio is muted. Returns true if the local audio is muted and false otherwise.
Declaration
public bool LocalAudioMuted { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LocalAudioUnmuteDisabled
Gets whether the local audio cannot be unmuted. Returns true if the local audio cannot be unmuted and false otherwise.
Declaration
public bool LocalAudioUnmuteDisabled { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LocalVideoDisabled
Gets or sets if local video is disabled.
Declaration
public bool LocalVideoDisabled { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LocalVideoMuted
Gets whether the local video is muted. Returns true if the local video is muted and false otherwise.
Declaration
public bool LocalVideoMuted { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LocalVideoUnmuteDisabled
Gets whether the local video cannot be unmuted. Returns true if the local video cannot be unmuted and false otherwise.
Declaration
public bool LocalVideoUnmuteDisabled { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
MediaId
Gets or sets the media identifier, for MCU or SFU upstream connections.
Declaration
public string MediaId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Recording
Gets or sets whether the connection is recording.
Declaration
public bool Recording { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
RecordingMode
Gets or sets the connection recording mode.
Declaration
public string RecordingMode { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
RecordingTag
Gets or sets the connection recording tag.
Declaration
public string RecordingTag { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
RemoteAudioDisabled
Gets or sets if remote audio is disabled.
Declaration
public bool RemoteAudioDisabled { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
RemoteAudioMuted
Gets or sets if remote audio is muted.
Declaration
public bool RemoteAudioMuted { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
RemoteConnectionId
Gets or sets the remote connection identifier, for peer or SFU downstream connections.
Declaration
public string RemoteConnectionId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
RemoteMediaId
Gets or sets the remote media identifier, for SFU downstream connections.
Declaration
public string RemoteMediaId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
RemoteVideoDisabled
Gets or sets if remote video is disabled.
Declaration
public bool RemoteVideoDisabled { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
RemoteVideoMuted
Gets or sets if remote video is muted.
Declaration
public bool RemoteVideoMuted { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
State
Gets or sets the connection state.
Declaration
public string State { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Tag
Gets or sets the connection tag.
Declaration
public string Tag { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Transports
Gets or sets the connection transport information.
This will be null if BUNDLE is inactive.
Declaration
public TransportInfo[] Transports { get; set; }
Property Value
| Type | Description |
|---|---|
| TransportInfo[] |
Type
Gets or sets the connection type.
Declaration
public string Type { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
UserAlias
Gets or sets the user alias.
Declaration
public string UserAlias { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
UserId
Gets or sets the user identifier.
Declaration
public string UserId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
UseWebSocketsForMedia
Gets or sets if we should use websockets for sending media.
Declaration
public bool UseWebSocketsForMedia { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
VideoDirection
Gets or sets the video stream direction.
Declaration
public string VideoDirection { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
VideoFormats
Gets the video formats, if applicable.
Declaration
public FormatInfo[] VideoFormats { get; }
Property Value
| Type | Description |
|---|---|
| FormatInfo[] |
VideoStream
Gets or sets the first connection video stream.
Declaration
public MediaStreamInfo VideoStream { get; set; }
Property Value
| Type | Description |
|---|---|
| MediaStreamInfo |
VideoStreams
Gets or sets the connection video streams.
Declaration
public MediaStreamInfo[] VideoStreams { get; set; }
Property Value
| Type | Description |
|---|---|
| MediaStreamInfo[] |
Methods
CreateClientInfo()
Creates a client info object with details from this connection info object.
Declaration
public ClientInfo CreateClientInfo()
Returns
| Type | Description |
|---|---|
| ClientInfo |
DeserializeProperties(String, String)
Deserializes the properties.
Declaration
protected override void DeserializeProperties(string key, string valueJson)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The key. |
| System.String | valueJson | The value in JSON format. |
Overrides
FromJson(String)
Deserializes Json to a ConnectionInfo.
Declaration
public static ConnectionInfo FromJson(string connectionInfoJson)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | connectionInfoJson | The serialized Json. |
Returns
| Type | Description |
|---|---|
| ConnectionInfo | The deserialized ConnectionInfo. |
FromJsonArray(String)
Deserializes an array of instances from JSON.
Declaration
public static ConnectionInfo[] FromJsonArray(string connectionInfosJson)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | connectionInfosJson | The JSON to deserialize. |
Returns
| Type | Description |
|---|---|
| ConnectionInfo[] | The deserialized connection infos. |
IsEquivalent(ConnectionInfo)
Tests for equivalency.
Declaration
public bool IsEquivalent(ConnectionInfo connectionInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| ConnectionInfo | connectionInfo | The connection information. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
IsEquivalent(String, String, String, String)
Tests for equivalency.
Declaration
public bool IsEquivalent(string userId, string deviceId, string clientId, string id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userId | The user identifier. |
| System.String | deviceId | The device identifier. |
| System.String | clientId | The client identifier. |
| System.String | id | The connection identifier. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
SerializeProperties(Dictionary<String, String>)
Serializes the properties.
Declaration
protected override void SerializeProperties(Dictionary<string, string> jsonObject)
Parameters
| Type | Name | Description |
|---|---|---|
| Dictionary<System.String, System.String> | jsonObject | The JSON object. |
Overrides
ShouldSerializeAudioDirection()
Gets whether to serialize the legacy audio direction property.
Declaration
public bool ShouldSerializeAudioDirection()
Returns
| Type | Description |
|---|---|
| System.Boolean |
ShouldSerializeAudioFormats()
Gets whether to serialize the legacy audio formats property.
Declaration
public bool ShouldSerializeAudioFormats()
Returns
| Type | Description |
|---|---|
| System.Boolean |
ShouldSerializeDataDirection()
Gets whether to serialize the legacy data direction property.
Declaration
public bool ShouldSerializeDataDirection()
Returns
| Type | Description |
|---|---|
| System.Boolean |
ShouldSerializeLocalAudioMuted()
Gets whether to serialize the legacy local audio muted property.
Declaration
public bool ShouldSerializeLocalAudioMuted()
Returns
| Type | Description |
|---|---|
| System.Boolean |
ShouldSerializeLocalVideoMuted()
Gets whether to serialize the legacy local video muted property.
Declaration
public bool ShouldSerializeLocalVideoMuted()
Returns
| Type | Description |
|---|---|
| System.Boolean |
ShouldSerializeVideoDirection()
Gets whether to serialize the legacy video direction property.
Declaration
public bool ShouldSerializeVideoDirection()
Returns
| Type | Description |
|---|---|
| System.Boolean |
ShouldSerializeVideoFormats()
Gets whether to serialize the legacy video formats property.
Declaration
public bool ShouldSerializeVideoFormats()
Returns
| Type | Description |
|---|---|
| System.Boolean |
ToJson()
Serializes this instance to Json.
Declaration
public string ToJson()
Returns
| Type | Description |
|---|---|
| System.String |
ToJson(ConnectionInfo)
Serializes an instance to Json.
Declaration
public static string ToJson(ConnectionInfo connectionInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| ConnectionInfo | connectionInfo | The instance to serialize. |
Returns
| Type | Description |
|---|---|
| System.String | Serialized Json. |
ToJsonArray(ConnectionInfo[])
Serializes an array of instances to JSON.
Declaration
public static string ToJsonArray(ConnectionInfo[] connectionInfos)
Parameters
| Type | Name | Description |
|---|---|---|
| ConnectionInfo[] | connectionInfos | The connection infos to serialize. |
Returns
| Type | Description |
|---|---|
| System.String | The serialized JSON. |