WebRTCStatsReporter class

Class to handle the reporting of WebRTC stats to the server via the provided socket and peerConnection. The callId and peerId are used to identify the call and peer respectively. Call quality metrics are updated every 100ms for real-time UI updates. Full stats are sent to the socket every 3 seconds to avoid overloading the connection. The stats reporting can be started and stopped using the startStatsReporting and stopStatsReporting methods. The collected stats are available in the Telnyx Portal for debugging purposes.

Constructors

WebRTCStatsReporter.new(TxSocket socket, RTCPeerConnection peerConnection, String callId, String peerId, bool sendStats, {CallQualityCallback? onCallQualityChange})
Default constructor that initializes the WebRTCStatsReporter with the provided parameters

Properties

callId String
final
debugReportStarted bool
getter/setter pair
debugStatsId String
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
onCallQualityChange CallQualityCallback?
Callback for call quality metrics updates
final
peerConnection → RTCPeerConnection
final
peerId String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendStats bool
final
socket TxSocket
final
uuid → Uuid
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startStatsReporting() Future<void>
stopStatsReporting() → void
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

callQualityIntervalMs → const int
Call quality update interval in milliseconds for real-time UI updates
socketStatsIntervalMs → const int
Socket stats reporting interval in milliseconds to avoid overloading