takeLocalSnapshot abstract method

CancelableOperation<LocalSnapshot> takeLocalSnapshot(
  1. StreamIndex streamIndex,
  2. String filePath
)

Takes a snapshot of the local video.

streamIndex: Stream type.

filePath: Save path for the snapshot.

If the API takes effect, you will receive a LocalSnapshot object, otherwise you will receive the following error codes:

  • -1: Failure. Fails to generate the image.
  • -2: Failure. The stream is invalid.
  • -3: Failure. Snapshot timeout, default 1s.
  • -100: API call exception.
  • -101: No taskId returned.
  • -102: File write failed.
  • -103: Wrong image format.

Note:

  • The snapshot is taken with all video effects on, like rotation, and mirroring.
  • You can take the snapshot either using SDK internal video capture or customized capture.

Implementation

CancelableOperation<LocalSnapshot> takeLocalSnapshot(
  StreamIndex streamIndex,
  String filePath,
);