From 49a8a08c94cbde6c255037892484f4405b92a878 Mon Sep 17 00:00:00 2001
From: 朱俊杰 <502612493@qq.com>
Date: 星期四, 24 八月 2023 17:12:39 +0800
Subject: [PATCH] 捕获启动过程中发送sip异常导致的启动失败
---
web_src/src/components/GBRecordDetail.vue | 44 ++++++++++++++++++++++++++++----------------
1 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/web_src/src/components/GBRecordDetail.vue b/web_src/src/components/GBRecordDetail.vue
old mode 100644
new mode 100755
index 938792a..f9fce20
--- a/web_src/src/components/GBRecordDetail.vue
+++ b/web_src/src/components/GBRecordDetail.vue
@@ -182,9 +182,11 @@
this.playerStyle["height"] = this.winHeight + "px";
this.chooseDate = moment().format('YYYY-MM-DD')
this.dateChange();
+ window.addEventListener('beforeunload', this.stopPlayRecord)
},
destroyed() {
this.$destroy('recordVideoPlayer');
+ window.removeEventListener('beforeunload', this.stopPlayRecord)
},
methods: {
dateChange(){
@@ -197,7 +199,7 @@
this.detailFiles = [];
this.$axios({
method: 'get',
- url: './api/gb_record/query/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + this.endTime
+ url: '/api/gb_record/query/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + this.endTime
}).then((res)=>{
this.recordsLoading = false;
if(res.data.code === 0) {
@@ -249,7 +251,7 @@
} else {
this.$axios({
method: 'get',
- url: './api/playback/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' +
+ url: '/api/playback/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' +
this.endTime
}).then((res)=> {
if (res.data.code === 0) {
@@ -273,7 +275,7 @@
console.log('鍓嶇鎺у埗锛氭挱鏀�');
this.$axios({
method: 'get',
- url: './api/playback/resume/' + this.streamId
+ url: '/api/playback/resume/' + this.streamId
}).then((res)=> {
this.$refs["recordVideoPlayer"].play(this.videoUrl)
});
@@ -282,14 +284,14 @@
console.log('鍓嶇鎺у埗锛氭殏鍋�');
this.$axios({
method: 'get',
- url: './api/playback/pause/' + this.streamId
+ url: '/api/playback/pause/' + this.streamId
}).then(function (res) {});
},
gbScale(command){
console.log('鍓嶇鎺у埗锛氬�嶉�� ' + command);
this.$axios({
method: 'get',
- url: `./api/playback/speed/${this.streamId }/${command}`
+ url: `/api/playback/speed/${this.streamId }/${command}`
}).then(function (res) {});
},
downloadRecord: function (row) {
@@ -311,7 +313,7 @@
}else {
this.$axios({
method: 'get',
- url: './api/gb_record/download/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' +
+ url: '/api/gb_record/download/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' +
row.endTime + '&downloadSpeed=4'
}).then( (res)=> {
if (res.data.code === 0) {
@@ -332,20 +334,24 @@
this.videoUrl = '';
this.$axios({
method: 'get',
- url: './api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.streamId
+ url: '/api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.streamId
}).then((res)=> {
if (callback) callback(res)
});
},
stopPlayRecord: function (callback) {
- this.$refs["recordVideoPlayer"].pause();
- this.videoUrl = '';
- this.$axios({
- method: 'get',
- url: './api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId
- }).then(function (res) {
- if (callback) callback()
- });
+ console.log("鍋滄褰曞儚鍥炴斁")
+ if (this.streamId !== "") {
+ this.$refs["recordVideoPlayer"].pause();
+ this.videoUrl = '';
+ this.$axios({
+ method: 'get',
+ url: '/api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId
+ }).then(function (res) {
+ if (callback) callback()
+ });
+ }
+
},
getDataWidth(item){
let timeForFile = this.getTimeForFile(item);
@@ -423,8 +429,14 @@
return hStr + ":" + mStr + ":" + sStr
},
goBack(){
+ // 濡傛灉姝e湪杩涜褰曞儚鍥炴斁鍒欙紝鍙戦�佸仠姝�
+ if (this.streamId !== "") {
+ this.stopPlayRecord(()=> {
+ this.streamId = "";
+ })
+ }
window.history.go(-1);
- }
+ },
}
};
</script>
--
Gitblit v1.8.0