文档中心
视频通话 (Legacy)
Console 官网 社区 技术支持

offline-如何设置推流组件的镜像模式?

分类: 集成类    平台: Android / iOS   最后更新时间: 2023/07/30 18:47:08

Android

Agora 推流组件提供多种场景下的镜像模式:

  • 本地主播看自己的视频镜像:这种镜像指本地预览的视频为镜像,你可以通过 VideoPreviewRender 类中的 setMirrorMode 方法实现。
  • 观众等其他远端用户看本地主播的视频镜像:这种镜像指本地发送的视频为镜像,你可以通过 StreamingKit 类中的 create 方法实现。

setMirrorMode 设置的镜像模式会受到 create 设置的镜像模式的影响,详见下表。

本地主播设备摄像头方向前置:

createmirrorMode setMirrorModemirrorMode 本地预览的视频效果 本地发送的视频效果
DISABLED AUTO 镜像 正常
DISABLED ENABLED 镜像 正常
DISABLED DISABLED 正常 正常
ENABLED AUTOENABLEDDISABLED 镜像 镜像
AUTO AUTOENABLEDDISABLED 镜像 镜像

本地主播设备摄像头方向后置:

createmirrorMode setMirrorModemirrorMode 本地预览的视频效果 本地发送的视频效果
DISABLED AUTO 正常 正常
DISABLED ENABLED 镜像 正常
DISABLED DISABLED 正常 正常
ENABLED AUTOENABLEDDISABLED 镜像 镜像
AUTO AUTO 正常 正常
AUTO ENABLED 镜像 正常
AUTO DISABLED 正常 正常

iOS

Agora 推流组件提供多种场景下的镜像模式:

  • 本地主播看自己的视频镜像:这种镜像指本地预览的视频为镜像,你可以通过 AgoraVideoPreviewRenderer 类中的 [setMirrorMode](https://docs.agora.io/cn/Interactive Broadcast/API Reference/rsk_oc/Classes/AgoraVideoPreviewRenderer.html#//api/name/setMirrorMode:) 方法实现。
  • 观众等其他远端用户看本地主播的视频镜像:这种镜像指本地发送的视频为镜像,你可以通过 AgoraStreamingKit 类中的 [sharedStreamingKitWithContext](https://docs.agora.io/cn/Interactive Broadcast/API Reference/rsk_oc/Classes/AgoraStreamingKit.html#//api/name/sharedStreamingKitWithContext:) 方法实现。

setMirrorMode 设置的镜像模式会受到 sharedStreamingKitWithContext 设置的镜像模式的影响,详见下表。

本地主播设备摄像头方向前置:

sharedStreamingKitWithContextmirrorMode setMirrorModemirrorMode 本地预览的视频效果 本地发送的视频效果
Disabled Auto 镜像 正常
Disabled Enabled 镜像 正常
Disabled Disabled 正常 正常
Enabled AutoEnabledDisabled 镜像 镜像
Auto AutoEnabledDisabled 镜像 镜像

本地主播设备摄像头方向后置:

sharedStreamingKitWithContextmirrorMode setMirrorModemirrorMode 本地预览的视频效果 本地发送的视频效果
Disabled Auto 正常 正常
Disabled Enabled 镜像 正常
Disabled Disabled 正常 正常
Enabled AutoEnabledDisabled 镜像 镜像
Auto Auto 正常 正常
Auto Enabled 镜像 正常
Auto Disabled 正常 正常