From 60875afdd717b54675fdc6bcc89cb81aa384319e Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Fri, 10 Jun 2022 19:31:11 +0800 Subject: [PATCH] 22 --- src/apps/AppBroadcast1/LiveBroadcast.vue | 45 ++++++++++++++++-------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/src/apps/AppBroadcast1/LiveBroadcast.vue b/src/apps/AppBroadcast1/LiveBroadcast.vue index 6c782242..09807305 100644 --- a/src/apps/AppBroadcast1/LiveBroadcast.vue +++ b/src/apps/AppBroadcast1/LiveBroadcast.vue @@ -220,31 +220,46 @@ } this.time = '00:00:00' - // this.blobToDataURI(blob).then(res => { - // console.log(res, (window.URL || webkitURL).createObjectURL(blob), '时长:' + duration + 'ms') - // }) - this.recordList.push({ - src: (window.URL || webkitURL).createObjectURL(blob), - isPlay: false, - duration: (duration / 1000).toFixed(0) - }) - - let formData = {} formData = new FormData() - formData.append('file', blob) + formData.append('file', new window.File([blob], `${(new Date).getTime()}` )) + this.$loading() this.$http.post(`/app/appdlbresource/uploadDlbFile`, formData).then(res => { if (res.code === 0) { - + this.$loading() + this.$http.post(`/app/appzyvideobroadcast/playrealtime`, { + mediaId: res.data.mediaId, + accessUrl: res.data.accessUrl, + messageLevel: 1, + taskType: 0, + coverageType: 4, + serialNo: this.equipmentList.map(v => v.serialNo).join(',') + }).then(res => { + if (res.code === 0) { + this.$u.toast('播发成功') + this.recordList.push({ + src: (window.URL || webkitURL).createObjectURL(blob), + isPlay: false, + duration: (duration / 1000).toFixed(0) + }) + this.isShowRecord = true + } + this.isShow = false + }).catch(() => { + this.isShow = false + }) + } else { + this.isShow = false } + }).catch(() => { + this.isShow = false }) - this.isShowRecord = true - this.isShow = false console.log(blob, (window.URL || webkitURL).createObjectURL(blob), '时长:' + duration + 'ms') }, msg => { console.log('录音失败:' + msg) this.recorder.close() + this.isShow = false this.recorder = null }) }, @@ -313,7 +328,7 @@ transition: all ease 0.5s; &.active { - z-index: 1111111111111; + z-index: 111; opacity: 1; }