智慧保安互联网APP
zengh
2021-08-12 356c5930e8bb7d36e1c01fe99606b00e4c0ea070
pages/videoCall/videoCall.nvue
@@ -263,7 +263,7 @@
                  
                  } else if (d.res == 1) {
                     that.channel = d.roomId;
                     console.log('对方在线-- 等待对方接受');
                     console.log('对方在线-- 等待对方接受',d);
                     // call = true;
                     setTimeout(res => {
                        // uni.navigateBack();
@@ -336,18 +336,19 @@
         // 初始化
         async init() {
            // 查看权限
            if (uni.getSystemInfoSync().platform == 'ios') {
               //查看相机权限
               await this.requestAndroidPermission("camera", 'ios');
               //查看录音权限
               await this.requestAndroidPermission("record", 'ios');
            console.log('开始初始化')
            // if (uni.getSystemInfoSync().platform == 'ios') {
            //    //查看相机权限
            //    await this.requestAndroidPermission("camera", 'ios');
            //    //查看录音权限
            //    await this.requestAndroidPermission("record", 'ios');
            } else if (uni.getSystemInfoSync().platform === 'android') {
            // } else if (uni.getSystemInfoSync().platform === 'android') {
               //查看相机权限
               await this.requestAndroidPermission("android.permission.CAMERA", 'android');
               //查看录音权限
               await this.requestAndroidPermission("android.permission.RECORD_AUDIO", 'android');
            }
            // }
            // 初始化 setCallBack
            await this.callbackFn();
            // 初始化 create
@@ -355,10 +356,15 @@
            await RtcModule.create({
               "appId": this.appid
            }, (res) => {
               console.log(res);
               console.log(res,11111111111111111111111111111111);
            });
            this.uid = this.randomFn(6);
            console.log(this.uid, '当前id码')
            console.log('初始化完成’',this.uid, '当前id码');
            uni.showToast({
               title: this.uid,
               duration: 2000,
               // icon: 'none'
            });
         },
         //设置角色
         setClientRole(num) {
@@ -381,6 +387,7 @@
               mask: true
            });
            //加入房间
            console.log('room', this.channel,'useid',this.uid)
            await RtcModule.joinChannel({
               "token": "",
               "channelId": this.channel,