rtcEngine$onRemoteSnapshotTakenToFile$info$filePath$width$height$errorCode$taskId method

FutureOr<void> rtcEngine$onRemoteSnapshotTakenToFile$info$filePath$width$height$errorCode$taskId(
  1. dynamic engine,
  2. dynamic streamId,
  3. dynamic info,
  4. dynamic filePath,
  5. dynamic width,
  6. dynamic height,
  7. dynamic errorCode,
  8. dynamic taskId,
)
override

@detail callback @valid since 3.60. @brief Triggered after calling takeRemoteSnapshotToFile:filePath:{@link #ByteRTCEngine#takeRemoteSnapshotToFile:filePath} to report whether the snapshot is taken successfully and provide details of the snapshot image. @param engine ByteRTCEngine object. @param streamId ID of the video stream for taking snapshot. @param info Stream information, see ByteRTCStreamInfo{@link #ByteRTCStreamInfo}. @param filePath The path where the snapshot file is saved. @param width The width (px) of the snapshot image. @param height The height (px) of the snapshot image. @param errorCode The error code for the snapshot task. See ByteRTCSnapshotErrorCode{@link #ByteRTCSnapshotErrorCode} for specific indications. @param taskId The index of the snapshot task, which matches the return value of takeRemoteSnapshotToFile:filePath:{@link #ByteRTCEngine#takeRemoteSnapshotToFile:filePath}.

Implementation

FutureOr<void>
    rtcEngine$onRemoteSnapshotTakenToFile$info$filePath$width$height$errorCode$taskId(
        dynamic engine,
        dynamic streamId,
        dynamic info,
        dynamic filePath,
        dynamic width,
        dynamic height,
        dynamic errorCode,
        dynamic taskId) async {
  if ($instance == null || $instance is! IRTCEngineEventHandler) {
    return;
  }
  return ($instance as IRTCEngineEventHandler)
      .onRemoteSnapshotTakenToFile
      ?.call(
          streamId.toString(),
          filePath.toString(),
          int.tryParse(width.toString()) ?? 0,
          int.tryParse(height.toString()) ?? 0,
          t_SnapshotErrorCode.ios_to_code($p_i.ByteRTCSnapshotErrorCode.values
              .firstWhere(
                  (t) => t.$value == errorCode || t.name == errorCode)),
          int.tryParse(taskId.toString()) ?? 0);
}