onPlayerStreamEvent method

void onPlayerStreamEvent(
  1. ZegoStreamEvent eventID,
  2. String streamID,
  3. String extraInfo
)

The callback triggered when playing stream.

Available since: 2.18.0 Description: After start playing stream, this callback will return the current stream address, resource type and protocol-related information. When to trigger: Play and retry play events. Caution: None.

  • eventID Play stream event ID
  • streamID Stream ID.
  • extraInfo extra info. it is in JSON format. Included information includes "url" for address, "streamProtocol" for stream protocol, including rtmp, flv, avertp, hls, webrtc, etc. "netProtocol" for network protocol, including tcp, udp, quic, "resourceType" for resource type , including cdn, rtc, l3.

Implementation

void onPlayerStreamEvent(
  ZegoStreamEvent eventID,
  String streamID,
  String extraInfo,
) {}