takeLocalSnapshotToFile method

FutureOr<long> takeLocalSnapshotToFile(
  1. String filePath
)

@detail api @author wangfujun.911 @brief Takes a snapshot of the local/remote video stream and save it as a JPG file at the specified local path.
After calling this method, the SDK triggers onLocalSnapshotTakenToFile{@link #IRTCEngineEventHandler#onLocalSnapshotTakenToFile} to report whether the snapshot is taken successfully and provide details of the snapshot image. @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> takeLocalSnapshotToFile(String filePath) async {
  return await nativeCall('takeLocalSnapshotToFile', [filePath]);
}