takeRemoteSnapshotToFile method
@detail api
@valid since 3.60.
@author wangfujun.911
@brief Take a 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 rtcEngine:onRemoteSnapshotTakenToFile:info:filePath:width:height:errorCode:taskId:{@link #ByteRTCEngineDelegate#rtcEngine:onRemoteSnapshotTakenToFile:info:filePath:width:height:errorCode:taskId} to report whether the snapshot is taken successfully and provide details of the snapshot.
@param streamId ID of the remote video stream for taking 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> takeRemoteSnapshotToFile(
NSString streamId, NSString filePath) async {
return await nativeCall(
'takeRemoteSnapshotToFile:filePath:', [streamId, filePath]);
}