iOS rtc互动直播时,rtckit提供了预览吗

rtmp 提供了主播预览 AgoraVideoPreviewRenderer,rtc呢

如果是加入频道外预览,可以看下 startPreview

为啥startPreview 失败呢

感谢
[self.rtcKit enableVideo];
AgoraRtcVideoCanvas *videoCanvas = [[AgoraRtcVideoCanvas alloc] init];
videoCanvas.uid = self.service.uid;
videoCanvas.channelId = self.service.channelId;
videoCanvas.renderMode = AgoraVideoRenderModeFit;
videoCanvas.view = self.previewCtrl.preview;
// 设置本地视图
[self.rtcKit setLocalRenderMode:AgoraVideoRenderModeFit mirrorMode:AgoraVideoMirrorModeEnabled];
[self.rtcKit enableLocalVideo:YES];
[self.rtcKit setupLocalVideo:videoCanvas];
bool ret = [self.rtcKit startPreview];
startPreview 失败,ret 为false

// ViewController.m

  • (void)setupLocalVideo {
    // 启用视频模块
    [self.agoraKit enableVideo];
    AgoraRtcVideoCanvas *videoCanvas = [[AgoraRtcVideoCanvas alloc] init];
    videoCanvas.uid = 0;
    videoCanvas.renderMode = AgoraVideoRenderModeHidden;
    videoCanvas.view = self.localView;
    // 设置本地视图
    [self.agoraKit setupLocalVideo:videoCanvas];
    [self.agoraKit startPreview];
    }