onPlayerSwitched property

(void Function(String streamID, int errorCode)?) onPlayerSwitched
read / write

Switch playing stream callback.

Available since: 3.16.0 Description: After calling the switchPlayingStream successfully, the result of switching streams can be obtained through this callback function. When to trigger: After calling the switchPlayingStream, this callback is triggered when a switch stream request ultimately succeeds or fails. Related callbacks: After the stream switching is successful or failed, you can obtain the current streaming status through the callback function onPlayerStateUpdate.

  • streamID The stream ID currently playing.
  • errorCode The error code corresponding to the result of the switch stream, please refer to the error codes document https://docs.zegocloud.com/en/5548.html for details.

Implementation

static void Function(String streamID, int errorCode)? onPlayerSwitched;