Video Capture Rotation
Feature Overview
ZEGO provides 4 capture rotation modes for mobile (fixed ratio mode, adaptive mode, alignment mode, and custom mode) to simplify the complex adaptation problems faced by developers when implementing multi-end rotation performance, such as camera angle, resolution, automatic rotation, StatusBar position adaptation, etc. You can configure different modes through the setAppOrientationMode interface based on rotation performance and business scenario requirements.
- To ensure the expected effect, the publishing and playing ends need to maintain the same mode during a call or in the same room.
- The publishing and playing versions need to be above v2.23.0 at the same time to use adaptive and alignment modes, so it is recommended to use them in new applications.
- PC, Web, and stream mixing services have adapted rotation modes. Since they do not have the rotation characteristics of mobile, the StatusBar defaults to the top of the screen.
- Fixed ratio mode supports all protocol scenarios. Adaptive and alignment modes only support ZEGO RTC private protocol and ZEGO stream mixing service.
Fixed Ratio Mode
In fixed ratio mode, the video output direction always maintains a fixed ratio relative to the StatusBar, and the video screen ratio depends on the encoding resolution ratio.
Advantage: Fixed ratio mode is applicable to all scenarios and is also a commonly used mode in live streaming scenarios. This mode has processed the rotation of the video screen at the capture end, and the playing end does not need additional processing, so there is no compatibility issue with live streaming distribution channels.
When the encoding ratio is vertical screen, the performance of the publishing and playing ends is as follows:
-
UI fixed to vertical screen:

-
UI not locked (App screen auto-rotation enabled):

Adaptive Mode
In adaptive mode, regardless of the holding method or UI direction, the image will always remain vertically facing up.
Advantage: In adaptive mode, users can choose their favorite holding method for video calls, suitable for 1v1 or multi-person video RTC scenarios. You can also implement live streaming business through stream mixing and relaying.
- Adaptive mode does not support direct CDN publishing. If you need live streaming, you can use ZEGO stream mixing service to process the rotation performance of multi-person screens before relaying to CDN. If needed, please contact ZEGO Technical Support to enable this configuration.
- Adaptive mode records information such as camera angle, holding method, and StatusBar position in the ZEGO private transmission protocol, so it only supports ZEGO RTC protocol and ZEGO stream mixing service.
Performance is as follows:

Alignment Mode
In alignment mode, using the StatusBar as a reference, the video direction at the playing end is consistent with the video direction of the publishing end preview. The playing end rotates the image using the StatusBar as a reference, and the rotation angle of the playing end is consistent with the rotation angle of the publishing end preview.
Advantage: Alignment mode is similar to adaptive mode, but users can combine the auto-rotation switch and holding method to actively adjust the full-screen or equal-ratio scaled screen performance, suitable for 1v1 or multi-person video RTC scenarios.
- Alignment mode does not support direct CDN publishing. If you need live streaming, you can use ZEGO stream mixing service to process the rotation performance of multi-person screens before relaying to CDN. If needed, please contact ZEGO Technical Support to enable this configuration.
- Alignment mode records information such as camera angle, holding method, and StatusBar position in the ZEGO private transmission protocol, so it only supports ZEGO RTC protocol and ZEGO stream mixing service.
-
When UI is fixed to vertical screen:

-
When UI is fixed to horizontal screen:

-
UI not locked (App screen auto-rotation enabled):

Custom Mode (Default)
In custom mode, you can customize the video capture rotation performance according to requirements, with more flexible implementation methods. For specific implementation steps, please refer to How to customize video capture rotation mode?
Implementation Process
Publishing End
The publishing end needs to call the setAppOrientationMode interface to set any capture rotation mode.
Please call the setAppOrientationMode interface immediately after calling createEngine, and then call the startPublishingStream or startPreview interface.
this.engine.setAppOrientationMode(ZegoOrientationMode.FixedResolutionRatio);Playing End
Only in adaptive mode, the playing end needs to call the setAppOrientationMode interface to set adaptive mode before playing streams.
- Please call the setAppOrientationMode interface immediately after calling createEngine to set the video orientation mode, and then call startPlayingStream to start playing streams.
- In adaptive mode, only supports playing streams from RTC.
this.engine.setAppOrientationMode(ZegoOrientationMode.Adaption);