Преглед на файлове

分辨率切换、三网问题

leo преди 9 месеца
родител
ревизия
8cedfb0ead
променени са 2 файла, в които са добавени 17 реда и са изтрити 46 реда
  1. 2 2
      static/rtcEngine/config/js/rtcEngine.min.js
  2. 15 44
      static/rtcEngine/js/WXtrialInterface.js

Файловите разлики са ограничени, защото са твърде много
+ 2 - 2
static/rtcEngine/config/js/rtcEngine.min.js


+ 15 - 44
static/rtcEngine/js/WXtrialInterface.js

@@ -77,17 +77,6 @@ const app = new Vue({
         copyTextVisible: false,
         // 卡数据
         userCardInfoData: {},
-        // 网络运营商对象
-        districtObj: {
-            '中国移动': 'webrtcTransferCmnet',
-            '中国电信': 'webrtcTransferTelecom',
-            '中国联通': 'webrtcTransferUnicom',
-            1: 'webrtcTransferCmnet',
-            2: 'webrtcTransferUnicom',
-            3: 'webrtcTransferTelecom'
-        },
-        districtValue: '',
-        // 是否显示欢迎弹框
         // 是否显示计时
         timingVisible: false,
         // 计费规则
@@ -187,14 +176,19 @@ const app = new Vue({
 
         // 连接webRTC
         connectWebRtc() {
-            const { sn, cardToken, internetHttps, internetHttp } = this.userCardInfoData;
+            const { sn, cardToken, internetHttps, internetHttp, webrtcTransferCmnet, webrtcTransferTelecom, webrtcTransferUnicom } = this.userCardInfoData;
             const isWss = location.protocol === 'https:'
-            const url = `${isWss ? 'wss://' :  'ws://'}${isWss ? internetHttps :  internetHttp}/nats`;
+            const url = `${isWss ? 'wss://' : 'ws://'}${isWss ? internetHttps : internetHttp}/nats`;
+            const IceMap = [
+                { "CMNET": webrtcTransferCmnet || '' }, // 移动
+                { 'CHINANET-GD': webrtcTransferTelecom || '' }, // 电信
+                { 'UNICOM-GD': webrtcTransferUnicom || '' }, // 联通
+            ];
             const connection = {
                 name: "猪猪令是猪",
                 topic: sn || "VMRK03k618sn45qza", // 云机ID 必填
                 url,  //信令服务地址  必填
-                ICEServerUrl: '120.232.206.145:3478',
+                ICEServerUrl: IceMap,
                 width: 720, // 推流视频宽度  必填
                 height: 1280,  // 推流视频高度  必填
                 // cardWidth: this.phoneSize.width || 1080,  // 云机系统分辨率 宽  必填
@@ -247,6 +241,8 @@ const app = new Vue({
                         Toast.clear();
                         this.confirmResolution()
                         playOnBtn.bind(this)()
+                        let { width, height, dpi: density } = this.phoneSize
+                        this.engine.makeResolution({ width, height, density })
                         this.pushflowPopup()
                         this.getResidueTime()
                         return
@@ -258,7 +254,8 @@ const app = new Vue({
                     // “currentRoundTripTime”:延迟 “lostRate”:丢包率 “seconds_KBytes”:带宽 “framesPerSecond”:帧率
                     // ballPosition.value = event.val
                     break;
-                case 'videoResolution': // 云机系统分辨率
+                case 'videoResolution': // 云机视频分辨率
+                    // console.log(event.val, '分辨率')
                     break
 
             }
@@ -306,16 +303,9 @@ const app = new Vue({
 
         // 确定修改分辨率
         confirmResolution() {
-            if(!Object.keys(this.phoneSize).length) return
-            let { width, height, dpi } = this.phoneSize
-            this.doConnectDirectivesWs.send(JSON.stringify({
-                type: "setPhoneSize",
-                data: {
-                    width,
-                    height,
-                    dpi
-                }
-            }))
+            if (!Object.keys(this.phoneSize).length) return
+            let { width, height, dpi: density } = this.phoneSize
+            this.engine.makeResolution({ width, height, density })
             this.resolutionRatioVisible = false
         },
 
@@ -607,25 +597,6 @@ const app = new Vue({
             })
         },
 
-        // // 获取网络运营商
-        // district() {
-        //     request.get('https://qifu-api.baidubce.com/ip/local/geo/v1/district').then(res => {
-        //         if (res.data) {
-        //             this.districtValue = res.data.isp || res.data.owner || ''
-        //         }
-        //         if (!this.districtValue) getOperatorNetworkByIp()
-        //     }).catch(err => {
-        //         getOperatorNetworkByIp.bind(this)()
-        //     })
-
-        //     function getOperatorNetworkByIp() {
-        //         request.get('/api/resources/user/cloud/getOperatorNetworkByIp').then(res => {
-        //             if (res.success) {
-        //                 this.districtValue = res.data.operatorNetwork
-        //             }
-        //         })
-        //     }
-        // },
         // 退出功能
         exit() {
             this.engine.disconnect && this.engine.disconnect();