takeSnapshot abstract method

Future<void> takeSnapshot(
  1. String channel,
  2. int uid,
  3. String filePath
)

Takes a snapshot of a video stream. This method takes a snapshot of a video stream from the specified user, generates a JPG image, and saves it to the specified path. The method is asynchronous, and the SDK has not taken the snapshot when the method call returns. After a successful method call, the SDK triggers snapshotTaken callback to report whether the snapshot is successfully taken as well as the details for the snapshot taken. Call this method after joining a channel. If the video of the specified user is pre-processed, for example, added with watermarks or image enhancement effects, the generated snapshot also includes the pre-processing effects.

Param channel The channel name.

Param uid The user ID. Set uid as 0 if you want to take a snapshot of the local user's video.

Param filePath The local path (including the filename extensions) of the snapshot. For example, Windows: C:\Users<user_name>\AppData\Local\Agora<process_name>\example.jpg iOS: /App Sandbox/Library/Caches/example.jpg macOS: ~/Library/Logs/example.jpg Android: /storage/emulated/0/Android/data/

Implementation

Future<void> takeSnapshot(String channel, int uid, String filePath);