您好,我正在尝试使用 Agora 配置视频流在iOS项目中,遇到这样的问题:删除视频比本地视频放大很多。
这是代码示例:
rtcEngine = AgoraRtcEngineKit.sharedEngine(withAppId: AppConstants.AgoraAppKey, delegate: delegate)
rtcEngine.setChannelProfile(.channelProfile_LiveBroadcasting)
rtcEngine.enableVideo()
rtcEngine.setVideoProfile(._VideoProfile_360P, swapWidthAndHeight: false)
rtcEngine.setClientRole(viewType == isBroadcaster ? .clientRole_Broadcaster : .clientRole_Audience , withKey: nil)
如果有人遇到此类问题,请分享您是如何解决此问题的。谢谢!
最佳答案
如果setChannelProfile
是直播,需要将swapWidthAndHeight
参数设置为true
。
func didRotateScreen() {
if rtcEngine != nil {
if UIDeviceOrientationIsLandscape(UIDevice.current.orientation) {
rtcEngine.setVideoProfile(._VideoProfile_360P, swapWidthAndHeight: false)
} else {
rtcEngine.setVideoProfile(._VideoProfile_360P, swapWidthAndHeight: true)
}
}
}
关于ios - 使用AgoraLab在本地和远程视频之间设置不同的缩放比例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43913222/