|
@@ -77,17 +77,6 @@ const app = new Vue({
|
|
copyTextVisible: false,
|
|
copyTextVisible: false,
|
|
// 卡数据
|
|
// 卡数据
|
|
userCardInfoData: {},
|
|
userCardInfoData: {},
|
|
- // 网络运营商对象
|
|
|
|
- districtObj: {
|
|
|
|
- '中国移动': 'webrtcTransferCmnet',
|
|
|
|
- '中国电信': 'webrtcTransferTelecom',
|
|
|
|
- '中国联通': 'webrtcTransferUnicom',
|
|
|
|
- 1: 'webrtcTransferCmnet',
|
|
|
|
- 2: 'webrtcTransferUnicom',
|
|
|
|
- 3: 'webrtcTransferTelecom'
|
|
|
|
- },
|
|
|
|
- districtValue: '',
|
|
|
|
- // 是否显示欢迎弹框
|
|
|
|
// 是否显示计时
|
|
// 是否显示计时
|
|
timingVisible: false,
|
|
timingVisible: false,
|
|
// 计费规则
|
|
// 计费规则
|
|
@@ -187,14 +176,19 @@ const app = new Vue({
|
|
|
|
|
|
// 连接webRTC
|
|
// 连接webRTC
|
|
connectWebRtc() {
|
|
connectWebRtc() {
|
|
- const { sn, cardToken, internetHttps, internetHttp } = this.userCardInfoData;
|
|
|
|
|
|
+ const { sn, cardToken, internetHttps, internetHttp, webrtcTransferCmnet, webrtcTransferTelecom, webrtcTransferUnicom } = this.userCardInfoData;
|
|
const isWss = location.protocol === 'https:'
|
|
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 = {
|
|
const connection = {
|
|
name: "猪猪令是猪",
|
|
name: "猪猪令是猪",
|
|
topic: sn || "VMRK03k618sn45qza", // 云机ID 必填
|
|
topic: sn || "VMRK03k618sn45qza", // 云机ID 必填
|
|
url, //信令服务地址 必填
|
|
url, //信令服务地址 必填
|
|
- ICEServerUrl: '120.232.206.145:3478',
|
|
|
|
|
|
+ ICEServerUrl: IceMap,
|
|
width: 720, // 推流视频宽度 必填
|
|
width: 720, // 推流视频宽度 必填
|
|
height: 1280, // 推流视频高度 必填
|
|
height: 1280, // 推流视频高度 必填
|
|
// cardWidth: this.phoneSize.width || 1080, // 云机系统分辨率 宽 必填
|
|
// cardWidth: this.phoneSize.width || 1080, // 云机系统分辨率 宽 必填
|
|
@@ -247,6 +241,8 @@ const app = new Vue({
|
|
Toast.clear();
|
|
Toast.clear();
|
|
this.confirmResolution()
|
|
this.confirmResolution()
|
|
playOnBtn.bind(this)()
|
|
playOnBtn.bind(this)()
|
|
|
|
+ let { width, height, dpi: density } = this.phoneSize
|
|
|
|
+ this.engine.makeResolution({ width, height, density })
|
|
this.pushflowPopup()
|
|
this.pushflowPopup()
|
|
this.getResidueTime()
|
|
this.getResidueTime()
|
|
return
|
|
return
|
|
@@ -258,7 +254,8 @@ const app = new Vue({
|
|
// “currentRoundTripTime”:延迟 “lostRate”:丢包率 “seconds_KBytes”:带宽 “framesPerSecond”:帧率
|
|
// “currentRoundTripTime”:延迟 “lostRate”:丢包率 “seconds_KBytes”:带宽 “framesPerSecond”:帧率
|
|
// ballPosition.value = event.val
|
|
// ballPosition.value = event.val
|
|
break;
|
|
break;
|
|
- case 'videoResolution': // 云机系统分辨率
|
|
|
|
|
|
+ case 'videoResolution': // 云机视频分辨率
|
|
|
|
+ // console.log(event.val, '分辨率')
|
|
break
|
|
break
|
|
|
|
|
|
}
|
|
}
|
|
@@ -306,16 +303,9 @@ const app = new Vue({
|
|
|
|
|
|
// 确定修改分辨率
|
|
// 确定修改分辨率
|
|
confirmResolution() {
|
|
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
|
|
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() {
|
|
exit() {
|
|
this.engine.disconnect && this.engine.disconnect();
|
|
this.engine.disconnect && this.engine.disconnect();
|