onRemoteSnapshotTakenToFile method

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

@detail callback @valid since 3.60. @brief Triggered after calling takeRemoteSnapshotToFile{@link #RTCEngine#takeRemoteSnapshotToFile} to report whether the snapshot is taken successfully and provide details of the snapshot image. @param streamId Information of the snapshotted video stream ID. @param streamInfo Information of the snapshotted video stream. See StreamInfo{@link #StreamInfo}. @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 SnapshotErrorCode{@link #SnapshotErrorCode} for specific indications. @param taskId The index for the snapshot task, which matches the return value of takeRemoteSnapshotToFile{@link #RTCEngine#takeRemoteSnapshotToFile}.

Implementation

FutureOr<void> onRemoteSnapshotTakenToFile(
    dynamic streamId,
    dynamic streamInfo,
    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.android_to_code($p_a.SnapshotErrorCode.values
              .firstWhere(
                  (t) => t.$value == errorCode || t.name == errorCode)),
          int.tryParse(taskId.toString()) ?? 0);
}