美文网首页
硅基RTC(1.0)iOS-SDK使⽤⽂档

硅基RTC(1.0)iOS-SDK使⽤⽂档

作者: 温柔vs先生 | 来源:发表于2021-12-02 14:16 被阅读0次

    新建⽇期: 2021-10-30
    修改⽇期: 2021-11-03

    ⼀. 物料准备

    GJDigitalSDK.framework、WebRTC.framework

    ⼆. 开发环境

    开发⼯具: Xcode

    三. sdk引⽤(参照TestDemo)

    • 1.将 GJDigitalSDK.framework和webrtc⽂件拖拽至工程的资源目录下:


      image.png
    • 2.Info.plist文件中添加相机权限和录音权限


      image.png

      sdk模块介绍:


      image.png
      1. 模块使⽤

    详细⻅TestDemo项⽬,关键代码样例:

    /// 初始化数据
        DigitalConfig *config = [DigitalConfig shareConfig];
        config.userPassword = @"123456";
        config.serverIP = @"new.guiji.ai";
        config.servePort = 5222;
        config.robotCode = @"230738573542952960";
        config.robotMode = @"bot";
        config.stunList = @[@"stun:47.114.110.197:23478"];
        config.domain = @"guiji.ai";
        config.resource = @"dhrtc";
        config.userJID = @"iray-proxy@guiji.ai";
        config.isShowLocalVideo = YES;
        config.isShowLocalAudio = YES;
        config.usingFrontCamera = NO;
    
        /// 初始化view
        DigitalView *view = [[DigitalView alloc] initWithFrame:self.view.bounds];
        view.delegate = self;
        [self.view addSubview:view];
    

    模块初始化设置

    
    /// 用户名字(deviceId) ,默认设备编号(已在sdk中设置)
    @property (nonatomic, copy) NSString * userName;
    
    /// 用户密码,默认123456
    @property (nonatomic, copy) NSString * userPassword;
    
    /// 信令控制服务器地址
    @property (nonatomic, copy) NSString * serverIP;
    
    // 信令控制服务器端口
    @property (nonatomic, assign) NSInteger servePort;
    
    /// 每次新建会话生成的唯一编号,不能重复
    @property (nonatomic, copy) NSString * uuid;
    
    /// 机器人编号用来选择对接的对象
    @property (nonatomic, copy) NSString * robotCode;
    
    /// 机器人话术驱动(对话模式,一问一答):"bot", 客户端驱动方式(驱动模式,文字音频直接驱动数字人):""
    @property (nonatomic, copy) NSString * robotMode;
    
    /// stun地址,ice服务器
    @property (nonatomic, copy) NSArray * stunList;
    
    /// 默认@"guiji.ai"
    @property (nonatomic, copy) NSString * domain;
    
    /// 默认dhrtc
    @property (nonatomic, copy) NSString * resource;
    
    /// 对方会话id,默认 iray-proxy@guiji.ai
    @property (nonatomic, copy) NSString * userJID;
    
    /// 是否读取本地语音(默认YES)
    @property (nonatomic, assign) BOOL isShowLocalAudio;
    
    /// 是否展示本地视频框(默认NO)
    @property (nonatomic, assign) BOOL isShowLocalVideo;
    
    /// 前置摄像头还是后置摄像头,默认前置(yes:前置,no:后置,)
    @property (nonatomic, assign) BOOL usingFrontCamera;
    
    + (DigitalConfig *)shareConfig;
    

    相关文章

      网友评论

          本文标题:硅基RTC(1.0)iOS-SDK使⽤⽂档

          本文链接:https://www.haomeiwen.com/subject/itzxzltx.html