OTSubscriberKitNetworkStatsDelegate
Used to monitor audio and video statistics for the subscriber. See [OTSubscriberKit networkStatsDelegate].
Methods
| Name | Description |
|---|---|
subscriber:videoNetworkStatsUpdated:(subscriber, stats) |
Sent periodically to report audio statistics for the subscriber. |
subscriber:audioNetworkStatsUpdated:(subscriber, stats) |
Sent periodically to report video statistics for the subscriber. |
subscriber:videoQualityChanged:reason:(subscriber, stats, reason) |
Called when a quality-related video event occurs for the subscriber. |
subscriber:networkConditionChanged:reason:(subscriber, mediaLinkStats, reason) |
Called whenever a network condition change is detected for the subscriber or the remote publisher. |
subscriber:mediaLinkStatsUpdated:(subscriber, mediaLinkStats) |
Called periodically to report media link statistics for the subscriber. |
subscriber:videoNetworkStatsUpdated:(subscriber, stats)
Sent periodically to report audio statistics for the subscriber.
Parameters:
| Name | Type | Description |
|---|---|---|
subscriber |
OTSubscriberKit * | The subscriber these statistic apply to. |
stats |
OTSubscriberKitVideoNetworkStats * | An OTSubscriberKitVideoNetworkStats object, which has properties for the video bytes received, video packets lost, and video packets received for the subscriber. |
subscriber:audioNetworkStatsUpdated:(subscriber, stats)
Sent periodically to report video statistics for the subscriber.
Parameters:
| Name | Type | Description |
|---|---|---|
subscriber |
OTSubscriberKit * | The subscriber these statistic apply to. |
stats |
OTSubscriberKitAudioNetworkStats * | An OTSubscriberKitAudioNetworkStats object, which has properties for the audio bytes received, audio packets lost, and audio packets received for the subscriber. |
subscriber:videoQualityChanged:reason:(subscriber, stats, reason)
Called when a quality-related video event occurs for the subscriber.
This delegate method is triggered when a significant disruption is detected in the subscriber’s video stream. Currently, it only triggers for video interruptions (pauses) lasting 5 seconds or longer, codec changes or resolution changes. Short freezes are tracked internally and reflected in the subscriber statistics, but no callback is triggered for each freeze due to their short duration and high frequency.
The reason parameter indicates the cause of the event and is considered in the following priority order: OTSubscriberVideoEventVideoInterrupt, OTSubscriberVideoEventCodecChange.
Unlike the [OTSubscriberKitDelegate subscriberVideoDisabled:reason:] and [OTSubscriberKitDelegate subscriberVideoEnabled:reason:] messages, which indicate that the subscriber’s video track has been turned off or on (for example, due to audio fallback or stream property updates), this callback reports quality-related changes. Applications can use this to update the UI, log telemetry, or notify users about video interruptions.
Parameters:
| Name | Type | Description |
|---|---|---|
subscriber |
OTSubscriberKit * | The subscriber instance whose video stream triggered this event. |
stats |
OTSubscriberKitVideoNetworkStats * | The latest subscriber video statistics at the time of the event. |
reason |
OTSubscriberVideoEventReason | The reason for the quality event, based on OTSubscriberVideoEventReason. |
subscriber:networkConditionChanged:reason:(subscriber, mediaLinkStats, reason)
Called whenever a network condition change is detected for the subscriber or the remote publisher.
This callback reports changes in overall network health rather than changes in the subscriber’s video track state. It differs from video enabled/disabled callbacks in that it provides diagnostic information about network conditions.
Both video and audio statistics are provided to give a complete view of media and network quality. Since audio and video share the same underlying transport, they also share the same local transport and remote participant statistics.
The reason parameter indicates the cause of the network condition change and is currently reported as OTNetworkReasonNetworkConditionChange.
Applications can use this callback to react to network issues, such as updating UI indicators, logging telemetry, or triggering adaptive behavior.
Parameters:
| Name | Type | Description |
|---|---|---|
subscriber |
OTSubscriberKit * | The subscriber whose network condition has changed. |
mediaLinkStats |
OTSubscriberKitMediaLinkStats * | The media link statistics. |
reason |
OTNetworkReason | The reason code for the network condition change. |
subscriber:mediaLinkStatsUpdated:(subscriber, mediaLinkStats)
Called periodically to report media link statistics for the subscriber. It provides transport-level metrics for both the local subscriber and the remote publisher.
Parameters:
| Name | Type | Description |
|---|---|---|
subscriber |
OTSubscriberKit * | The subscriber instance. |
mediaLinkStats |
OTSubscriberKitMediaLinkStats * | The media link statistics. |