| | |
| | | </el-col> |
| | | <el-col span="12"> |
| | | <el-form-item label="历史视频"> |
| | | <el-button type="primary" @click="queryOldVideo(form)">查看视频</el-button> |
| | | <el-button type="primary" @click.stop="queryOldVideo(form)" |
| | | >查看视频</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-row :align="center"> |
| | | <el-col :offset="4"> |
| | | <el-form-item> |
| | | <el-button type="success">一键呼叫</el-button> |
| | | <el-button |
| | | :class="{ active: isActive }" |
| | | type="success" |
| | | @click.stop="aKeyToCall($event, form)" |
| | | >一键呼叫</el-button |
| | | > |
| | | <el-button type="success">视频对讲</el-button> |
| | | <el-button type="primary" @click.stop="generate(form)" |
| | | >生成警单</el-button |
| | |
| | | import Hls from "hls.js"; |
| | | |
| | | import axios from "axios"; |
| | | |
| | | import Recorder from "js-audio-recorder"; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | } |
| | | ] |
| | | }, |
| | | data: [] |
| | | data: [], |
| | | isActive: false |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }, |
| | | |
| | | beginTimeOrEndTime(time) { |
| | | |
| | | var beginTime = new Date(time); |
| | | |
| | | var endTime = new Date(new Date(time).valueOf() - 1000 * 60 * 60 * 3); |
| | |
| | | .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: "001231409472", |
| | | // startTime: "20210130150000", |
| | | // endTime: "20210130160000", |
| | | // 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.innerVisibleVideo = true; |
| | | // this.innerVisibleVideo = true; |
| | | |
| | | // this.videoSource = result.data.data.m3u8; |
| | | // this.videoSource = result.data.data.m3u8; |
| | | |
| | | // }); |
| | | // }); |
| | | }); |
| | | }, |
| | | openOldVideoBox() { |
| | |
| | | |
| | | this.hls = new Hls(); |
| | | |
| | | console.log(this.videoSource, '19028321321r073'); |
| | | console.log(this.videoSource, "19028321321r073"); |
| | | |
| | | var m3u8Url = decodeURIComponent(this.videoSource); |
| | | |
| | |
| | | dom.pause(); |
| | | |
| | | dom.setAttribute(""); |
| | | } |
| | | }, |
| | | aKeyToCall(e, form) { |
| | | // 一键呼叫相关函数 |
| | | if (this.isActive == true) { |
| | | this.isActive = false; |
| | | } else { |
| | | this.isActive = true; |
| | | |
| | | let recorder = new Recorder({ |
| | | sampleBits: 16, // 采样位数,支持 8 或 16,默认是16 |
| | | sampleRate: 16000, // 采样率,支持 11025、16000、22050、24000、44100、48000,根据浏览器默认值,我的chrome是48000 |
| | | numChannels: 1 // 声道,支持 1 或 2, 默认是1 |
| | | // compiling: false,(0.x版本中生效,1.x增加中) // 是否边录边转换,默认是false |
| | | }); |
| | | |
| | | var newAxios = axios.create({ |
| | | baseURL: "http://s16s652780.51mypc.cn", |
| | | withCredentials: false, |
| | | headers: { |
| | | "Content-type": "application/x-www-form-urlencoded" |
| | | } |
| | | }); |
| | | |
| | | |
| | | // newAxios |
| | | // .post( |
| | | // `/talk?deviceCode=${form.channelNumber}`, |
| | | // '12345', |
| | | // ) |
| | | // .then(result => { |
| | | |
| | | // console.log(result) |
| | | |
| | | // }); |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | height: calc(100% - 54px); |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .el-button.active { |
| | | background: red; |
| | | } |
| | | </style> |