switchPlayingResource method

Future<void> switchPlayingResource(
  1. String streamID,
  2. ZegoResourceType resourceType
)

Switch from playing one resource type to playing another resource type.

Available since: 3.25.0 Description: Smoothly switch from one resource type to another resource type. Use cases: First, play the L3 or CDN stream, then switch to the RTC stream to reduce latency. When to call: After startPlayingStream. Restrictions: Make sure the feature for the target resource type is enabled. Related callbacks: The current streaming status can be known through the onPlayerStateUpdate event.

  • streamID Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and '-', '_'.
  • resourceType Target resource type.

Implementation

Future<void> switchPlayingResource(
    String streamID, ZegoResourceType resourceType) async {
  return await ZegoExpressImpl.instance
      .switchPlayingResource(streamID, resourceType);
}