takeRemoteSnapshotToFile method

FutureOr<long> takeRemoteSnapshotToFile(
  1. String streamId,
  2. String filePath
)

@detail api @author wangfujun.911 @brief Takes snapshot of the remote video stream and save it as a JPG file at the specified local path.
After calling this method, the SDK triggers onRemoteSnapshotTakenToFile{@link #IRTCEngineEventHandler#onRemoteSnapshotTakenToFile} to report whether the snapshot is taken successfully and provide details of the snapshot image. @param streamId ID of the remote video stream. @param filePath The absolute file path where the snapshot JPG file will be saved. The file extension must be .jpg. Ensure that the directory exists and is writable. Example: /sdcard/Pictures/snapshot.jpg. @return The index of the remote snapshot task, starting from 1. The index can be used to track the task status or perform other management operations.

Implementation

FutureOr<long> takeRemoteSnapshotToFile(
    String streamId, String filePath) async {
  return await nativeCall('takeRemoteSnapshotToFile', [streamId, filePath]);
}