| | |
| | | * @Author: Morpheus |
| | | * @Date: 2021-03-17 15:21:33 |
| | | * @Last Modified by: Morpheus |
| | | * @Last Modified time: 2021-03-19 15:21:40 |
| | | * @Last Modified time: 2021-03-19 16:56:35 |
| | | */ |
| | | <template> |
| | | <basic-container> |
| | |
| | | ...params, |
| | | }; |
| | | |
| | | console.log(this.$router.query, 111) |
| | | console.log(this.$router.query, 111); |
| | | |
| | | params = { |
| | | alarmType:this.$router.query.alarmType |
| | | if ( |
| | | this.$router.query && |
| | | this.$router.query != null && |
| | | this.$router.query != "" |
| | | ) { |
| | | params = { |
| | | alarmType: this.$router.query.alarmType, |
| | | }; |
| | | } |
| | | |
| | | |
| | | if (releaseTimeRange) { |
| | | values = { |
| | | ...params, |
| | |
| | | // }); |
| | | }); |
| | | }, |
| | | |
| | | closeRealVideoBox() { |
| | | var dom = document.getElementById("video_conversation"); |
| | | |
| | |
| | | }, |
| | | }); |
| | | var that = this; |
| | | setInterval(() => { |
| | | // 一键呼叫相关函数 |
| | | Recorder.getPermission().then(() => { |
| | | Recorder.getPermission().then(() => { |
| | | setInterval(() => { |
| | | // 一键呼叫相关函数 |
| | | that.recorder.start().then(() => { |
| | | // 开始录音 |
| | | newCallAxios |
| | |
| | | } |
| | | ) |
| | | .then((result) => { |
| | | var formData = new FormData(); |
| | | var blob = that.recorder.getPCMBlob(); //获取pcm格式音频数据 |
| | | //此处获取到blob对象后需要设置fileName满足当前项目上传需求,其它项目可直接传把blob作为file塞入formData |
| | | var newbolb = new Blob([blob], { type: "audio/pcm" }); |
| | | var fileOfBlob = new File( |
| | | [newbolb], |
| | | new Date().getTime() + ".pcm" |
| | | ); |
| | | formData.append("file", fileOfBlob); |
| | | setTimeout(() => { |
| | | var formData = new FormData(); |
| | | var blob = that.recorder.getPCMBlob(); //获取pcm格式音频数据 |
| | | //此处获取到blob对象后需要设置fileName满足当前项目上传需求,其它项目可直接传把blob作为file塞入formData |
| | | var newbolb = new Blob([blob], { type: "audio/pcm" }); |
| | | var fileOfBlob = new File( |
| | | [newbolb], |
| | | new Date().getTime() + ".pcm" |
| | | ); |
| | | formData.append("file", fileOfBlob); |
| | | |
| | | // var dom = document.getElementById("real_audio"); |
| | | // dom.setAttribute("src", URL.createObjectURL(blob)); |
| | | // var dom = document.getElementById("real_audio"); |
| | | // dom.setAttribute("src", URL.createObjectURL(blob)); |
| | | |
| | | // this.recorder.play(); |
| | | // this.recorder.play(); |
| | | |
| | | newCallAxios |
| | | .post(`/api_control`, blob, { |
| | | params: { |
| | | param: { |
| | | PktType: "Talk", |
| | | accessToken: result.data.data.accessToken, |
| | | // deviceCode: form.channelNumber, |
| | | deviceCode: "001231663A45", |
| | | newCallAxios |
| | | .post(`/api_control`, blob, { |
| | | params: { |
| | | param: { |
| | | PktType: "Talk", |
| | | accessToken: result.data.data.accessToken, |
| | | // deviceCode: form.channelNumber, |
| | | deviceCode: "001231663A45", |
| | | }, |
| | | }, |
| | | }, |
| | | }) |
| | | .then((result) => {}); |
| | | }) |
| | | .then((result) => {}); |
| | | }, 10000); |
| | | }); |
| | | }); |
| | | }); |
| | | }, 5000); |
| | | }, 5000); |
| | | }); |
| | | }, |
| | | |
| | | aKeyToCall111(e, form) { |
| | |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | |
| | | // 一键呼叫相关函数 |
| | | }, 200000); |
| | | }, |