| | |
| | | </el-col> |
| | | <el-col span="12"> |
| | | <el-form-item label="历史视频"> |
| | | <el-button type="primary">查看视频</el-button> |
| | | <el-button type="primary" @click="queryOldVideo(form)">查看视频</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | }, |
| | | |
| | | beginTimeOrEndTime(time) { |
| | | |
| | | var beginTime = new Date(time); |
| | | |
| | | var endTime = new Date(new Date(time).valueOf() - 1000 * 30); |
| | | var endTime = new Date(new Date(time).valueOf() - 1000 * 60 * 60 * 3); |
| | | |
| | | var beginY = beginTime.getFullYear(); |
| | | |
| | |
| | | endTime.getSeconds() < 10 |
| | | ? "0" + endTime.getSeconds() |
| | | : endTime.getSeconds(); |
| | | |
| | | return { |
| | | begin: beginY + beginM + beginD + beginH + beginm + begins, |
| | | end: endY + endM + endD + endH + endm + ends |
| | |
| | | "Content-type": "application/x-www-form-urlencoded" |
| | | } |
| | | }); |
| | | |
| | | //s16s652780.51mypc.cn/api_control |
| | | |
| | | var time = this.beginTimeOrEndTime(data.alarmTime); |
| | | |
| | |
| | | .then(res => { |
| | | console.log(res.data.data.accessToken); |
| | | |
| | | newAxios |
| | | .get( |
| | | `/GetPlayUrl?deviceCode=${data.channelNumber}&chl=${data.serialNumber}` |
| | | ) |
| | | .then(result => { |
| | | this.innerVisibleVideo = true; |
| | | newAxios |
| | | .get( |
| | | `/GetPlayUrl?deviceCode=${data.channelNumber}&chl=${data.serialNumber}` |
| | | ) |
| | | .then(result => { |
| | | this.innerVisibleVideo = true; |
| | | |
| | | this.videoSource = result.data.data.m3u8; |
| | | }); |
| | | this.videoSource = result.data.data.m3u8; |
| | | }); |
| | | |
| | | // newAxios |
| | | // .post( |
| | | // "/api_control", |
| | | // {}, |
| | | // { |
| | | // params: { |
| | | // param: JSON.stringify({ |
| | | // PktType: "RemotePlayback", |
| | | // accessToken: res.data.data.accessToken, |
| | | // deviceCode: data.channelNumber, |
| | | // startTime: time.end, |
| | | // endTime: time.begin, |
| | | // chl: data.serialNumber |
| | | // }) |
| | | // } |
| | | // } |
| | | // ) |
| | | // .then(result => { |
| | | // newAxios |
| | | // .post( |
| | | // "/api_control", |
| | | // {}, |
| | | // { |
| | | // params: { |
| | | // param: JSON.stringify({ |
| | | // PktType: "RemotePlayback", |
| | | // accessToken: res.data.data.accessToken, |
| | | // deviceCode: "001231409472", |
| | | // startTime: "20210130150000", |
| | | // endTime: "20210130160000", |
| | | // chl: data.serialNumber |
| | | // }) |
| | | // } |
| | | // } |
| | | // ) |
| | | // .then(result => { |
| | | |
| | | |
| | | // this.videoSource = result.data.data.m3u8 |
| | | // this.innerVisibleVideo = true; |
| | | |
| | | // this.innerVisibleVideo = true |
| | | // this.videoSource = result.data.data.m3u8; |
| | | |
| | | // }); |
| | | // }); |
| | | }); |
| | | }, |
| | | openOldVideoBox() { |
| | |
| | | |
| | | this.hls = new Hls(); |
| | | |
| | | console.log(this.videoSource, '19028321321r073'); |
| | | |
| | | var m3u8Url = decodeURIComponent(this.videoSource); |
| | | |
| | | console.log(m3u8Url); |
| | | |
| | | this.hls.loadSource(m3u8Url); |
| | | |
| | | this.hls.attachMedia(dom); |