onActiveVideoLayer method

FutureOr<void> onActiveVideoLayer(
  1. dynamic streamId,
  2. dynamic streamInfo,
  3. dynamic videoIndex,
  4. dynamic active,
)
override

@valid since 3.56 @detail callback @brief As the sender of a external encoded video stream, you will receive this callback at certain moments.
Based on the hints of this callback, you can selectively encode the video stream that is ready for transmission, in order to reduce the performance impact of video encoding on the local device. This callback is triggered based on a combination of factors, including the performance of the local device, the local network, and whether the stream is subscribed by the remote user. @param streamId See StreamIndex. @param streamInfo See StreamIndex. @param videoIndex Subscript of the corresponding encoded stream. @param active The active state of the corresponding encoded stream. @note To receive the callback, call setVideoSourceType{@link #RTCEngine#setVideoSourceType} to set the input video source to custom encoded video and call setExternalVideoEncoderEventHandler{@link #RTCEngine#setExternalVideoEncoderEventHandler} to set the callback handler.

Implementation

FutureOr<void> onActiveVideoLayer(dynamic streamId, dynamic streamInfo,
    dynamic videoIndex, dynamic active) async {
  if ($instance == null || $instance is! IExternalVideoEncoderEventHandler) {
    return;
  }
  return ($instance as IExternalVideoEncoderEventHandler)
      .onActiveVideoLayer
      ?.call(streamId.toString(), int.tryParse(videoIndex.toString()) ?? 0,
          active);
}