|
@@ -174,7 +174,7 @@ const app = new Vue({
|
|
|
|
|
|
// 连接webRTC
|
|
|
connectWebRtc() {
|
|
|
- console.time('获取推流响应消耗时间:')
|
|
|
+ // console.time('获取推流响应消耗时间:')
|
|
|
this.plugFlowStartTime = +new Date()
|
|
|
const { sn: topic, cardToken: authToken, internetHttps, internetHttp, webrtcTransferCmnet, webrtcTransferTelecom, webrtcTransferUnicom } = this.userCardInfoData;
|
|
|
const isWss = location.protocol === 'https:'
|
|
@@ -215,7 +215,7 @@ const app = new Vue({
|
|
|
switch (event.type) {
|
|
|
case "screenChange":
|
|
|
// 0:横屏 1:竖屏
|
|
|
- console.log("屏幕方向变化事件:" + event.val);
|
|
|
+ // console.log("屏幕方向变化事件:" + event.val);
|
|
|
this.isLandscape = event.val === 0;
|
|
|
break;
|
|
|
case "wsState":
|
|
@@ -237,25 +237,26 @@ const app = new Vue({
|
|
|
break;
|
|
|
case "rtcState":
|
|
|
// “connected”:rtc链接成功 “failed”:rtc链接失败 “closed”:rtc链接关闭 “disconnected”:rtc链接超时
|
|
|
+ // console.log(event.val, 'rtc链接成功状态')
|
|
|
if (event.val === "connected") {
|
|
|
- Toast.clear();
|
|
|
- this.doConnectDirectives()
|
|
|
- this.isShowVideo = true
|
|
|
- this.$refs.rtcMediaPlayer.muted = true
|
|
|
- this.$refs.rtcMediaPlayer.play()
|
|
|
- let ms = +new Date - this.plugFlowStartTime
|
|
|
- console.timeEnd('获取推流响应消耗时间:')
|
|
|
- console.log(`获取推流响应消耗时间:${ms / 1000}秒`)
|
|
|
- this.definitionFun(this.definitionValue)
|
|
|
- this.pushflowPopup()
|
|
|
- this.getResidueTime()
|
|
|
+ // Toast.clear();
|
|
|
+ // this.doConnectDirectives()
|
|
|
+ // this.isShowVideo = true
|
|
|
+ // this.$refs.rtcMediaPlayer.play()
|
|
|
+ // let ms = +new Date - this.plugFlowStartTime
|
|
|
+ // console.timeEnd('获取推流响应消耗时间:')
|
|
|
+ // console.log(`获取推流响应消耗时间:${ms / 1000}秒`)
|
|
|
+ // this.definitionFun(this.definitionValue)
|
|
|
+ // this.pushflowPopup()
|
|
|
+ // this.getResidueTime()
|
|
|
+ playOnBtn.bind(this)()
|
|
|
return
|
|
|
}
|
|
|
if (event.val === "connecting") return
|
|
|
this.exit()
|
|
|
break;
|
|
|
case "AuthenticationStatus":
|
|
|
- console.log(`鉴权${event.val === "success" ? '成功' : '失败'}`);
|
|
|
+ // console.log(`鉴权${event.val === "success" ? '成功' : '失败'}`);
|
|
|
break;
|
|
|
case "StreamStates":
|
|
|
// “currentRoundTripTime”:延迟 “lostRate”:丢包率 “seconds_KBytes”:带宽 “framesPerSecond”:帧率
|
|
@@ -266,10 +267,10 @@ const app = new Vue({
|
|
|
// console.log(event.val, '分辨率')
|
|
|
break
|
|
|
case 'networkService': // 获取三网信息
|
|
|
- console.log("三网信息:", event.val);
|
|
|
+ // console.log("三网信息:", event.val);
|
|
|
break
|
|
|
case 'networkServiceURL': // 获取三网信息
|
|
|
- console.log("三网IP地址:", event.val);
|
|
|
+ // console.log("三网IP地址:", event.val);
|
|
|
break
|
|
|
}
|
|
|
},
|
|
@@ -531,7 +532,6 @@ const app = new Vue({
|
|
|
message: '数据加载中...',
|
|
|
});
|
|
|
this.obtainCardInfoStartTime = + new Date()
|
|
|
- console.time('获取卡信息响应消耗时间:')
|
|
|
let { userCardId } = this.parametersData
|
|
|
userCardId = +userCardId
|
|
|
const statusTips = {
|
|
@@ -565,8 +565,6 @@ const app = new Vue({
|
|
|
}
|
|
|
this.userCardInfoData = res.data
|
|
|
let ms = + new Date() - this.obtainCardInfoStartTime
|
|
|
- console.timeEnd('获取卡信息响应消耗时间:')
|
|
|
- console.log(`获取卡信息响应消耗时间:${ms / 1000}秒`)
|
|
|
this.connectWebRtc()
|
|
|
return
|
|
|
case 5200:
|
|
@@ -769,6 +767,31 @@ const app = new Vue({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+function playOnBtn() {
|
|
|
+ const { isTips } = this.parametersData;
|
|
|
+ Dialog.alert({
|
|
|
+ title: '提示',
|
|
|
+ message: `${+isTips ? '开始' : '继续'}使用云手机`,
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ confirmButtonColor: '#3cc51f',
|
|
|
+ beforeClose: (action, done) => {
|
|
|
+ if (action === 'confirm') {
|
|
|
+ this.isShowVideo = true
|
|
|
+ Toast.clear();
|
|
|
+ this.$refs.rtcMediaPlayer.play()
|
|
|
+ setTimeout(() => {
|
|
|
+ this.doConnectDirectives()
|
|
|
+ this.definitionFun(this.definitionValue)
|
|
|
+ this.pushflowPopup()
|
|
|
+ this.getResidueTime()
|
|
|
+ done()
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
// 获取URL参数
|
|
|
function getParameters() {
|