onPlayerStateUpdate property
The callback triggered when the state of stream playing changes.
Available since: 1.1.0
Description: After calling the startPlayingStream successfully, the notification of the playing stream state change can be obtained through the callback function. You can roughly judge the user's downlink network status based on whether the state parameter is in PLAY_REQUESTING.
When to trigger: After calling the startPublishingStream, this callback is triggered when a playing stream's state changed.
Related callbacks: After calling the startPublishingStream successfully, the notification of the publish stream state change can be obtained through the callback function onPublisherStateUpdate. You can roughly judge the user's uplink network status based on whether the state parameter is in PUBLISH_REQUESTING.
streamIDstream ID.stateState of playing stream.errorCodeThe error code corresponding to the status change of the playing stream, please refer to the error codes document https://docs.zegocloud.com/en/5548.html for details.extendedDataExtended Information with state updates. As the standby, only an empty json table is currently returned.
Implementation
static void Function(String streamID, ZegoPlayerState state, int errorCode,
Map<String, dynamic> extendedData)? onPlayerStateUpdate;