setVideoCaptureRotation method

FutureOr<int> setVideoCaptureRotation(
  1. ByteRTCVideoRotation rotation
)

@detail api @hiddensdk(audiosdk) @author zhaomingliang @brief 设置本端采集的视频帧的旋转角度。
当摄像头倒置或者倾斜安装时,可调用本接口进行调整。对于手机等普通设备,可调用 setVideoRotationMode:{@link #ByteRTCEngine#setVideoRotationMode} 实现旋转。 @param rotation 相机朝向角度,默认为 ByteRTCVideoRotation0,无旋转角度。详见 ByteRTCVideoRotation{@link #ByteRTCVideoRotation}。 @return - 0: 调用成功。 - < 0 : 调用失败。查看 ByteRTCReturnStatus{@link #ByteRTCReturnStatus} 获得更多错误说明 @note - 对于内部采集的视频画面,如果已调用 setVideoRotationMode:{@link #ByteRTCEngine#setVideoRotationMode} 设置了旋转方向,会在此基础上叠加旋转角度。 - 调用本接口也将对自定义采集视频画面生效,在原有的旋转角度基础上叠加本次设置。 - 视频贴纸特效或通过 enableVirtualBackground{@link #ByteRTCVideoEffect#enableVirtualBackground:withSource} 增加的虚拟背景,也会跟随本接口的设置进行旋转。 - 本地渲染视频和发送到远端的视频都会相应旋转,但不会应用到单流转推中。如果希望在单流转推的视频中应用旋转,调用 setVideoOrientation:{@link #ByteRTCEngine#setVideoOrientation}。

Implementation

FutureOr<int> setVideoCaptureRotation(ByteRTCVideoRotation rotation) async {
  return await nativeCall('setVideoCaptureRotation:', [rotation.$value]);
}