takeSnapshotWithConfigEx abstract method

Future<void> takeSnapshotWithConfigEx({
  1. required RtcConnection connection,
  2. required int uid,
  3. required SnapshotConfig config,
})

使用连接 ID 获取指定观测位置的视频截图。

该方法用于对指定用户的视频流进行截图,生成一张 JPG 格式的图片,并保存至指定的路径。 该方法是异步操作,调用返回时 SDK 并没有真正获取截图。 该方法用于本地视频截图时,是对 ChannelMediaOptions 中指定发布的视频流进行截图。 如果用户的视频经过前处理,例如,添加了水印或美颜,生成的截图会包含前处理效果。

  • connection Connection 信息。详见 RtcConnection 。
  • uid 用户 ID。如果要对本地用户的视频截图,则设为 0。
  • config 截图设置,详见 SnapshotConfig 。

Returns 方法成功调用时,无返回值;方法调用失败时,会抛出 AgoraRtcException 异常,你需要捕获异常并进行处理。详见错误码了解详情和解决建议。

Implementation

Future<void> takeSnapshotWithConfigEx(
    {required RtcConnection connection,
    required int uid,
    required SnapshotConfig config});