|
@@ -45,7 +45,7 @@
|
|
|
<div>
|
|
|
<a-dropdown>
|
|
|
<a-menu selectable slot="overlay" @click="onVideoListClick">
|
|
|
- <a-menu-item v-for="item in videoList" :key="item.id"> {{item.name}} </a-menu-item>
|
|
|
+ <a-menu-item v-for="item in videoList" :key="item.gbId"> {{item.name}} </a-menu-item>
|
|
|
</a-menu>
|
|
|
<a class="ant-dropdown-link" @click="e => e.preventDefault()">
|
|
|
{{curVideo&&curVideo.name}}
|
|
@@ -185,6 +185,7 @@
|
|
|
data: {
|
|
|
xdType: 'video', // 巡店类型
|
|
|
player: null, // 播放器对象
|
|
|
+ videoPlayerStatus:'',// 视频播放状态
|
|
|
videoList: [], // 播放通道
|
|
|
curVideo: null, // 当前播放的视频
|
|
|
showYt: false, // 显示云台控制
|
|
@@ -245,7 +246,7 @@
|
|
|
setVideoList(data) {
|
|
|
this.videoList = JSON.parse(data)
|
|
|
this.curVideo = this.videoList[0]
|
|
|
- this.videoInit()
|
|
|
+ this.getVideoUrl()
|
|
|
},
|
|
|
// 获取任务详情
|
|
|
getTaskDetail(data) {
|
|
@@ -259,23 +260,31 @@
|
|
|
this.showLoading = false
|
|
|
},
|
|
|
// 选择机位
|
|
|
- onVideoListClick({
|
|
|
- key
|
|
|
- }) {
|
|
|
- let v = this.videoList.find(item => item.id == key)
|
|
|
+ onVideoListClick({key}) {
|
|
|
+ let v = this.videoList.find(item => item.gbId == key)
|
|
|
if (v) {
|
|
|
this.curVideo = v
|
|
|
- // 重置播放器
|
|
|
- this.showYt = false
|
|
|
- this.showYtbtns = false
|
|
|
+ this.getVideoUrl()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取当前设备流地址
|
|
|
+ getVideoUrl(){
|
|
|
+ this.sendMsg('getVideoUrl', JSON.stringify(this.curVideo))
|
|
|
+ },
|
|
|
+ // 获取视频地址成功
|
|
|
+ getVideoUrlSuccess(url){
|
|
|
+ console.log(url)
|
|
|
+ // 重置播放器
|
|
|
+ this.showYt = false
|
|
|
+ this.showYtbtns = false
|
|
|
+ if(this.player){
|
|
|
this.player.dispose()
|
|
|
- this.videoInit()
|
|
|
}
|
|
|
+ this.videoInit(url)
|
|
|
},
|
|
|
// 初始化播放器
|
|
|
- videoInit() {
|
|
|
+ videoInit(videoSrc) {
|
|
|
const _this = this
|
|
|
- const videoSrc = this.curVideo.videoSrc
|
|
|
// 初始化播放器
|
|
|
_this.player = new Aliplayer({
|
|
|
'id': 'player-con',
|
|
@@ -336,7 +345,8 @@
|
|
|
})
|
|
|
// 控制栏
|
|
|
_this.player.on('playing', function() {
|
|
|
- _this.showYt = true
|
|
|
+ // _this.showYt = true
|
|
|
+ _this.videoPlayerStatus = 'playing'
|
|
|
})
|
|
|
_this.player.on('error', function(e) {
|
|
|
console.log(JSON.stringify(e), 'error')
|
|
@@ -367,7 +377,6 @@
|
|
|
},
|
|
|
// 打开抓拍照片弹框
|
|
|
openCamera(index) {
|
|
|
- this.showPz = true
|
|
|
this.activeZbIndex = index
|
|
|
this.sendMsg('getWinStatus', JSON.stringify({
|
|
|
key: 'showPz',
|
|
@@ -376,6 +385,32 @@
|
|
|
// 当前查看的指标对象
|
|
|
let obj = this.zbItem[this.activeZbIndex]
|
|
|
this.curZbItem = JSON.parse(JSON.stringify(obj))
|
|
|
+ // 抓拍
|
|
|
+ this.takePhotos()
|
|
|
+ },
|
|
|
+ // 抓拍
|
|
|
+ takePhotos(){
|
|
|
+ this.sendMsg('takePhotos',JSON.stringify({
|
|
|
+ streamId: this.curVideo.streamId,
|
|
|
+ videoPlayerStatus: this.videoPlayerStatus,
|
|
|
+ type: 1
|
|
|
+ }))
|
|
|
+ },
|
|
|
+ // 拍照成功后,返回图片地址
|
|
|
+ takePhotoSuccess(url){
|
|
|
+ let obj = {
|
|
|
+ id: new Date().getTime(),
|
|
|
+ photoPath: url
|
|
|
+ }
|
|
|
+ console.log(this.curZbItem.taskTargetPhotoVOList)
|
|
|
+ if(this.curZbItem.taskTargetPhotoVOList){
|
|
|
+ this.curZbItem.taskTargetPhotoVOList = [obj]
|
|
|
+ }else{
|
|
|
+ this.curZbItem.taskTargetPhotoVOList.push(obj)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 显示弹框
|
|
|
+ this.showPz = true
|
|
|
},
|
|
|
// 关闭抓拍弹框
|
|
|
onClosePz() {
|