From e1af52fb5eaf0bcac221ba11cc90da7cd50d2895 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 30 九月 2022 15:51:28 +0800
Subject: [PATCH] 更新文档
---
web_src/src/components/dialog/devicePlayer.vue | 64 +++++++++++++++++++------------
1 files changed, 39 insertions(+), 25 deletions(-)
diff --git a/web_src/src/components/dialog/devicePlayer.vue b/web_src/src/components/dialog/devicePlayer.vue
index fac02fd..4c8f264 100644
--- a/web_src/src/components/dialog/devicePlayer.vue
+++ b/web_src/src/components/dialog/devicePlayer.vue
@@ -1,7 +1,7 @@
<template>
<div id="devicePlayer" v-loading="isLoging">
- <el-dialog title="瑙嗛鎾斁" top="0" :close-on-click-modal="false" :visible.sync="showVideoDialog" :destroy-on-close="true" @close="close()">
+ <el-dialog title="瑙嗛鎾斁" top="0" :close-on-click-modal="false" :visible.sync="showVideoDialog" @close="close()">
<!-- <LivePlayer v-if="showVideoDialog" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" :message="videoError" :hasaudio="hasaudio" fluent autoplay live></LivePlayer> -->
<div style="width: 100%; height: 100%">
<el-tabs type="card" :stretch="true" v-model="activePlayer" @tab-click="changePlayer" v-if="Object.keys(this.player).length > 1">
@@ -118,6 +118,10 @@
<el-dropdown-item :command="streamInfo.rtc">
<el-tag >RTC:</el-tag>
<span>{{ streamInfo.rtc }}</span>
+ </el-dropdown-item>
+ <el-dropdown-item :command="streamInfo.rtcs">
+ <el-tag >RTCS:</el-tag>
+ <span>{{ streamInfo.rtcs }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.rtmp">
<el-tag >RTMP:</el-tag>
@@ -411,6 +415,9 @@
console.log(this.videoUrl)
},
openDialog: function (tab, deviceId, channelId, param) {
+ if (this.showVideoDialog) {
+ return;
+ }
this.tabActiveName = tab;
this.channelId = channelId;
this.deviceId = deviceId;
@@ -872,7 +879,8 @@
}
});
}else if (this.broadcastStatus === 1) {
- this.stopBroadcast()
+ this.broadcastStatus = -1;
+ this.broadcastRtc.close()
}
},
startBroadcast(url){
@@ -887,6 +895,7 @@
message: "鑾峰彇鎺ㄦ祦閴存潈Key澶辫触",
type: "error",
});
+ this.broadcastStatus = -1;
}else {
let pushKey = res.data.data.pushKey;
// 鑾峰彇鎺ㄦ祦閴存潈KEY
@@ -920,6 +929,7 @@
message: '涓嶆敮鎸亀ebrtc, 鏃犳硶杩涜璇煶瀵硅',
type: 'error'
});
+ this.broadcastStatus = -1;
});
this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_ICE_CANDIDATE_ERROR,(e)=>{// ICE 鍗忓晢鍑洪敊
@@ -929,6 +939,7 @@
message: 'ICE 鍗忓晢鍑洪敊',
type: 'error'
});
+ this.broadcastStatus = -1;
});
this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED,(e)=>{// offer anwser 浜ゆ崲澶辫触
@@ -938,6 +949,7 @@
message: 'offer anwser 浜ゆ崲澶辫触' + e,
type: 'error'
});
+ this.broadcastStatus = -1;
});
this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_ON_CONNECTION_STATE_CHANGE,(e)=>{// offer anwser 浜ゆ崲澶辫触
console.log('鐘舵�佹敼鍙�',e)
@@ -956,36 +968,38 @@
message: '鎹曡幏娴佸け璐�' + e,
type: 'error'
});
+ this.broadcastStatus = -1;
});
}
+ }).catch((e) => {
+ this.$message({
+ showClose: true,
+ message: e,
+ type: 'error'
+ });
+ this.broadcastStatus = -1;
});
},
stopBroadcast(){
- if (this.broadcastStatus === -1) {
- this.broadcastStatus = 1;
- }else {
- this.broadcastStatus = -2;
- this.broadcastRtc = null;
- this.$axios({
- method: 'get',
- url: '/api/play/broadcast/stop/' + this.deviceId + '/' + this.channelId
- }).then( (res)=> {
- if (res.data.code == 0) {
- // this.broadcastStatus = -1;
- // this.broadcastRtc.close()
- }else {
- this.$message({
- showClose: true,
- message: res.data.msg,
- type: "error",
- });
- }
- });
- }
-
-
+ this.broadcastRtc.close();
+ this.broadcastStatus = -1;
+ this.$axios({
+ method: 'get',
+ url: '/api/play/broadcast/stop/' + this.deviceId + '/' + this.channelId
+ }).then( (res)=> {
+ if (res.data.code == 0) {
+ // this.broadcastStatus = -1;
+ // this.broadcastRtc.close()
+ }else {
+ this.$message({
+ showClose: true,
+ message: res.data.msg,
+ type: "error",
+ });
+ }
+ });
}
}
};
--
Gitblit v1.8.0