How to set mirror mode in Express?
ZEGO Express SDK provides the functionality to mirror video during encoding. You can call the setVideoMirrorMode interface before publishing or after stopping publishing. Use the "mirrorMode" parameter to set whether the local preview video and the published video (the video seen by the remote user) enable mirror mode. You can choose the specific mode according to your actual needs.
- setVideoMirrorMode also supports setting during the publishing process and takes effect immediately.
- If your data is not rendered by the SDK, the local preview mirror in the mirror mode set by setVideoMirrorMode is invalid.
The currently supported mirror modes are as follows:
| Enum Value | Meaning | Description |
|---|---|---|
| NO_MIRROR | Both local preview and the video seen by the stream playing end are not mirrored. | After setting this mode, the local and remote views are not affected, that is, both are original effects. |
| ONLY_PREVIEW_MIRROR | Only local preview is mirrored, this mode is used by default. | On the local device, the local user's video stream is bound to the local view. The user can see the mirror effect displayed by the local view, and the remote view is not affected (that is, the original effect). |
| ONLY_PUBLISH_MIRROR | Only the video seen by the stream playing end is mirrored. | After the local video stream is encoded, it will be sent to the remote user to watch. After setting this mode, only the remote user's view is mirrored, which does not affect the local user's view (that is, the original effect). |
| BOTH_MIRROR | Both local preview and the video seen by the stream playing end are mirrored. | After setting this mode, both local and remote users' views are affected, that is, both are mirrored effects. |
The effects of the four mirror modes are as follows:

Taking setting the stream playing end mirror and local preview non-mirror as an example, the sample code for each platform is as follows:
- iOS/macOS
[[ZegoExpressEngine sharedEngine] setVideoMirrorMode:ZegoVideoMirrorModeOnlyPublishMirror];- Android
engine.setVideoMirrorMode(ZegoVideoMirrorMode.ONLY_PUBLISH_MIRROR);- Windows
engine->setVideoMirrorMode(ZegoVideoMirrorMode::ONLY_PUBLISH_MIRROR);