ios - 使用AgoraLab在本地和远程视频之间设置不同的缩放比例

标签 ios swift video-streaming

您好,我正在尝试使用 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/

相关文章:

objective-c - 在导航 Controller 上方添加放大镜

ios - UIGestureRecognizer 只为 subView 添加,但它也适用于 parentView?

ios - 将数据 POST 到 PHP 并使用 SwiftyJSON 获取 JSON

ios - tableHeaderView 未正确调整大小

audio - 在 Roku 中播放 MultipleAudioTrack

javascript - React-Native 不变违规 : Element type is invalid

ios - 使用 GPUImage 的模糊 View 动画

c++ - 如何在 Linux 中的虚拟网络摄像头上写字?

ios - 使搜索功能快速响应 ui 搜索栏中输入的文本 [swift]

ffmpeg 转码流视频和存储