setVideoCaptureRotation method
@detail api
@hiddensdk(audiosdk)
@brief Set the rotation of the video images captured from the local device.
Call this API to rotate the videos when the camera is fixed upside down or tilted. For rotating videos on a phone, we recommend to use setVideoRotationMode{@link #RTCEngine#setVideoRotationMode}.
@param rotation It defaults to VIDEO_ROTATION_0(0), which means not to rotate. Refer to VideoRotation{@link #VideoRotation}.
@return
- 0: Success.
- < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details
@note
- For the videos captured by the internal module, the rotation will be combined with that set by calling setVideoRotationMode{@link #RTCEngine#setVideoRotationMode}.
- This API affects the external-sourced videos. The final rotation would be the original rotation angles adding up with the rotation set by calling this API.
- The elements added during the video pre-processing stage, such as video sticker and background applied using enableVirtualBackground{@link #IVideoEffect#enableVirtualBackground} will also be rotated by this API.
- The rotation would be applied to both locally rendered video s and those sent out. However, if you need to rotate a video which is intended for pushing to CDN individually, use setVideoOrientation{@link #RTCEngine#setVideoOrientation}.
Implementation
Future<int?> setVideoCaptureRotation(VideoRotation rotation) async {
$a() => ($instance as $p_a.RTCEngine)
.setVideoCaptureRotation(t_VideoRotation.code_to_android(rotation));
$i() => ($instance as $p_i.ByteRTCEngine)
.setVideoCaptureRotation(t_VideoRotation.code_to_ios(rotation));
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}