| | |
| | | <el-col span="12"> |
| | | <el-form-item label="监控视频"> |
| | | <el-button :class="{ active: isActive }" |
| | | v-if="form.manufacturers != 'HK'" |
| | | type="success" |
| | | @click.stop=" |
| | | (videoConversationReal = true), (oldVideoSatart = false) |
| | |
| | | @mousedown.native="aKeyToCall" |
| | | @mouseup.native="aKeyStopCall">视频通话 |
| | | </el-button> |
| | | |
| | | <el-button :class="{ active: isActive }" |
| | | v-if="form.manufacturers == 'HK'" |
| | | type="success" |
| | | @click.stop="HKCall(form)" |
| | | >海康语音通话 |
| | | @click.stop=" |
| | | (videoConversationReal = true), (oldVideoSatart = false) |
| | | " |
| | | @mousedown.native="HKCall(form)" |
| | | @mouseup.native="HKStopCall(form)">海康语音通话 |
| | | </el-button> |
| | | <el-button :class="{ active: isActive }" |
| | | type="success" |
| | | @click.stop="HKStopCall(form)" |
| | | >关闭语音通话 |
| | | </el-button> |
| | | |
| | | <el-button v-show="false" |
| | | type="primary" |
| | | @click.stop=" |
| | |
| | | szId: 'play_window', |
| | | szBasePath: "/", |
| | | iMaxSplit: 4, |
| | | iCurrentSplit: 1 , |
| | | iCurrentSplit: 1, |
| | | openDebug: true, |
| | | oStyle: { |
| | | borderSelect: '#000', |
| | | borderSelect: '#000', |
| | | } |
| | | }); |
| | | // 事件回调绑定 |
| | |
| | | }, |
| | | methods: { |
| | | HKCall(e) { |
| | | this.isActive = true; |
| | | var that = this; |
| | | if (this.recorder == null) { |
| | | this.recorder = new Recorder({ |
| | | sampleBits: 16, // 采样位数,支持 8 或 16,默认是16 |
| | | sampleRate: 8000, // 采样率,支持 11025、16000、22050、24000、44100、48000,根据浏览器默认值,我的chrome是48000 |
| | | numChannels: 1, // 声道,支持 1 或 2, 默认是1 |
| | | // compiling: false,(0.x版本中生效,1.x增加中) // 是否边录边转换,默认是false |
| | | }); |
| | | } |
| | | axios({ |
| | | method: "get", |
| | | url: `/api/blade-jfpts/equipment/equipment/EquimentVoice?`, |
| | |
| | | this.player.JS_StartTalk(url).then( |
| | | () => { |
| | | console.log('talkStart success') |
| | | // 一键呼叫相关函数 |
| | | that.recorder.start().then( |
| | | () => { |
| | | // 开始录音 |
| | | }, |
| | | (error) => { |
| | | // 出错了 |
| | | console.log(`${error.name} : ${error.message}`); |
| | | } |
| | | ); |
| | | }, |
| | | e => { |
| | | console.error(e) |
| | |
| | | }); |
| | | }, |
| | | HKStopCall() { |
| | | this.isActive = false; |
| | | var that = this; |
| | | this.player.JS_StopTalk().then( |
| | | () => { console.log('talkStop success') }, |
| | | e => { console.error(e) } |
| | | () => { |
| | | console.log('talkStop success') |
| | | var formData = new FormData(); |
| | | // that.recorder.downloadWAV("新文件"); |
| | | |
| | | 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 wavBlob = that.recorder.getWAVBlob(); |
| | | |
| | | var wavformData = new FormData(); |
| | | var wavform = new File([wavBlob], new Date().getTime() + ".wav"); |
| | | wavformData.append("file", wavform); |
| | | console.log( |
| | | wavBlob, |
| | | wavform, |
| | | wavformData, |
| | | wavformData.entries(), |
| | | 132 |
| | | ); |
| | | axios({ |
| | | method: "post", |
| | | url: "/api/blade-jfpts/xlfeedback/xlfeedback/put-objecty", |
| | | data: wavformData, |
| | | params: { |
| | | jid: that.form.id, |
| | | }, |
| | | }).then((resdata) => { |
| | | |
| | | console.log(resdata); |
| | | }); |
| | | }, |
| | | e => { |
| | | console.error(e) |
| | | } |
| | | ) |
| | | }, |
| | | realOpenVideoDialog() { |