支持级联国标录像下载

This commit is contained in:
648540858
2023-05-09 17:31:58 +08:00
parent affbd89fdb
commit a2da81f79a
8 changed files with 71 additions and 21 deletions

View File

@@ -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(){
@@ -338,14 +340,18 @@
});
},
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(){
// 如果正在进行录像回放则,发送停止
if (this.streamId !== "") {
this.stopPlayRecord(()=> {
this.streamId = "";
})
}
window.history.go(-1);
}
},
}
};
</script>

View File

@@ -21,7 +21,7 @@ import moment from "moment";
export default {
name: 'recordDownload',
created() {
window.addEventListener('beforeunload', this.stopDownloadRecord)
},
data() {
@@ -197,6 +197,9 @@ export default {
console.log(error);
});
}
},
destroyed() {
window.removeEventListener('beforeunload', this.stopDownloadRecord)
}
};
</script>