Class ConnectionStats
Connection stats.
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class ConnectionStats : BaseStats
Properties
AudioMediaQuality
Gets the audio streams' minimum estimated media quality.
The value ranges from 0.0 to 1.0, where 0.0 is the lowest quality and 1.0 is the highest quality.
Declaration
public double AudioMediaQuality { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
AudioNetworkQuality
Gets the audio streams' minimum estimated network quality.
The value ranges from 0.0 to 1.0, where 0.0 is the lowest quality and 1.0 is the highest quality.
Declaration
public double AudioNetworkQuality { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
AudioReceiverNetworkScore
Gets the audio receiver streams' estimated network score.
The value ranges from 1.0 to 5.0, where 1.0 is the lowest score and 5.0 is the highest score.
Declaration
public double AudioReceiverNetworkScore { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
AudioStream
Gets the first audio stream's stats.
Declaration
public MediaStreamStats AudioStream { get; }
Property Value
| Type | Description |
|---|---|
| MediaStreamStats |
AudioStreams
Gets the audio streams' stats.
Declaration
public MediaStreamStats[] AudioStreams { get; }
Property Value
| Type | Description |
|---|---|
| MediaStreamStats[] |
DataStream
Gets the data stream's stats.
Declaration
public DataStreamStats DataStream { get; }
Property Value
| Type | Description |
|---|---|
| DataStreamStats |
ExternalId
Gets or sets the external identifier.
Declaration
public string ExternalId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
IsHost
Gets whether any of the streams are using a transport whose active candidate pair has a host candidate.
Declaration
public bool IsHost { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsReflexive
Gets whether any of the streams are using a transport whose active candidate pair has a reflexive candidate.
Declaration
public bool IsReflexive { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsRelayed
Gets whether any of the streams are using a transport whose active candidate pair has a relayed candidate.
Declaration
public bool IsRelayed { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
MediaQuality
Gets the connection's estimated media quality as the minimum of the AudioMediaQuality and the VideoMediaQuality.
The value ranges from 0.0 to 1.0, where 0.0 is the lowest quality and 1.0 is the highest quality.
Declaration
public double MediaQuality { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
MediaStream
Gets the first media stream's stats.
Declaration
public MediaStreamStats MediaStream { get; }
Property Value
| Type | Description |
|---|---|
| MediaStreamStats |
MediaStreams
Gets the media streams' stats.
Declaration
public MediaStreamStats[] MediaStreams { get; }
Property Value
| Type | Description |
|---|---|
| MediaStreamStats[] |
NetworkQuality
Gets the connection's estimated network quality as the minimum of the AudioNetworkQuality and the VideoNetworkQuality.
The value ranges from 0.0 to 1.0, where 0.0 is the lowest quality and 1.0 is the highest quality.
Declaration
public double NetworkQuality { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
ReceiverNetworkScore
Gets the connection's estimated network score as the minimum of the AudioReceiverNetworkScore and the VideoReceiverNetworkScore.
The value ranges from 1.0 to 5.0, where 1.0 is the lowest score and 5.0 is the highest score.
Declaration
public double ReceiverNetworkScore { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
State
Gets or sets the state.
Declaration
public ConnectionState State { get; set; }
Property Value
| Type | Description |
|---|---|
| ConnectionState |
Streams
Gets the streams' stats.
Declaration
public StreamStats[] Streams { get; }
Property Value
| Type | Description |
|---|---|
| StreamStats[] |
VideoMediaQuality
Gets the video streams' minimum estimated media quality.
The value ranges from 0.0 to 1.0, where 0.0 is the lowest quality and 1.0 is the highest quality.
Declaration
public double VideoMediaQuality { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
VideoNetworkQuality
Gets the video streams' minimum estimated network quality.
The value ranges from 0.0 to 1.0, where 0.0 is the lowest quality and 1.0 is the highest quality.
Declaration
public double VideoNetworkQuality { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
VideoReceiverNetworkScore
Gets the video receiver streams' estimated network score.
The value ranges from 1.0 to 5.0, where 1.0 is the lowest score and 5.0 is the highest score.
Declaration
public double VideoReceiverNetworkScore { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
VideoStream
Gets the first video stream's stats.
Declaration
public MediaStreamStats VideoStream { get; }
Property Value
| Type | Description |
|---|---|
| MediaStreamStats |
VideoStreams
Gets the video streams' stats.
Declaration
public MediaStreamStats[] VideoStreams { get; }
Property Value
| Type | Description |
|---|---|
| MediaStreamStats[] |
Methods
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)
Derializes connection stats from JSON.
Declaration
public static ConnectionStats FromJson(string connectionJson)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | connectionJson | The connection's stats JSON. |
Returns
| Type | Description |
|---|---|
| ConnectionStats |
GetMediaStream(String)
Gets a media stream by its identifier.
Declaration
public MediaStreamStats GetMediaStream(string mediaStreamId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | mediaStreamId | The media stream identifier. |
Returns
| Type | Description |
|---|---|
| MediaStreamStats |
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
ToJson()
Serializes this to JSON.
Declaration
public string ToJson()
Returns
| Type | Description |
|---|---|
| System.String |
ToJson(ConnectionStats)
Serializes connection stats to JSON.
Declaration
public static string ToJson(ConnectionStats connection)
Parameters
| Type | Name | Description |
|---|---|---|
| ConnectionStats | connection | The connection's stats. |
Returns
| Type | Description |
|---|---|
| System.String |