setVideoEncoderRotation method
Set the direction of image output by video encoder (i.e., video image viewed by remote user and recorded by server)
When an Android phone or tablet is rotated 180 degrees, as the capture direction of the camera does not change, the video image viewed by remote users will be upside-down. In this case, you can call this API to rotate the image output by the SDK to remote users 180 degrees, so that remote users can view the normal image.
Note: the SDK will enable the G-sensor by default, and this API won't take effect in this case. It will work only after G-sensor is disabled.
Parameters:
rotation
Clockwise rotation angle. Currently, only 0 degrees and 180 degrees are supported:
TRTCCloudDef.TRTC_VIDEO_ROTATION_0 : no rotation (default value); TRTCCloudDef.TRTC_VIDEO_ROTATION_180 : clockwise rotation by 180 degrees
Platform not supported:
- web
Implementation
Future<void> setVideoEncoderRotation(
int rotation // Currently, rotation angles of `TRTC_VIDEO_ROTATION_0` and `TRTC_VIDEO_ROTATION_180` are supported. Default
) {
return _cloudChannel!.invokeMethod('setVideoEncoderRotation', {
"rotation": rotation,
});
}