takeLocalSnapshotToFile method

FutureOr<NSInteger> takeLocalSnapshotToFile(
  1. NSString filePath
)

@detail api @valid since 3.60. @author wangfujun.911 @brief Takes a snapshot of the local video stream and save it as a JPG file at the specified local path.
After calling this method, the SDK triggers rtcEngine:onLocalSnapshotTakenToFile:filePath:width:height:errorCode:taskId:{@link #ByteRTCEngineDelegate#rtcEngine:onLocalSnapshotTakenToFile:filePath:width:height:errorCode:taskId} to report whether the snapshot is taken successfully and provide details of the snapshot. @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: /Users/YourName/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<NSInteger> takeLocalSnapshotToFile(NSString filePath) async {
  return await nativeCall('takeLocalSnapshotToFile:', [filePath]);
}