onPlayerStateUpdate method

void onPlayerStateUpdate(
  1. String streamID,
  2. ZegoPlayerState state,
  3. int errorCode,
  4. Map<String, dynamic> extendedData,
)

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 down-link 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.

  • streamID stream ID.
  • state State of playing stream.
  • errorCode The 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.
  • extendedData Extended Information with state updates. As the standby, only an empty json table is currently returned.

Implementation

void onPlayerStateUpdate(
  String streamID,
  ZegoPlayerState state,
  int errorCode,
  Map<String, dynamic> extendedData,
) {}