Enabling sender-side statistics
To receive sender-side statistics, enable them for the stream’s publisher by setting the senderStatsTrack property to true for the OTPublisherKitSettings object used to create the publisher.
If senderStatsTrack is not enabled, no sender statistics channel will be published for this publisher. The default value is false.
Subscribing to sender-side statistics
To receive sender statistics, set the networkStatsDelegate for a subscriber:
Then implement the listener for either video or audio stats:
Receiving statistics events
The OTSubscriberKitNetworkStatsDelegate callbacks for video and audio deliver sender-side statistics, as shown above. The OTSenderStats, included as the senderStats member in both OTSubscriberKitVideoNetworkStats and OTSubscriberKitAudioNetworkStats, provides two properties:
connectionMaxAllocatedBitrate— The maximum bitrate estimated for the connectionconnectionEstimatedBandwidth— The current estimated bandwidth for the connection
These two metrics are calculated per audio-video bundle, so the same values appear in both video and audio statistics. Because they reflect the transport rather than individual tracks, the metrics are shared across both audio and video.
Sample app
See the vonage-video-ios-sdk-samples sender-side statistics sample.