This commit is contained in:
liuye
2022-06-11 11:43:23 +08:00

View File

@@ -97,7 +97,8 @@
equipmentList: [],
recordList: [],
innerAudioContext: null,
currIndex: -1
currIndex: -1,
broadcastId: ''
}
},
@@ -220,31 +221,47 @@
}
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,
broadcastId: this.broadcastId || '',
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 +330,7 @@
transition: all ease 0.5s;
&.active {
z-index: 1111111111111;
z-index: 111;
opacity: 1;
}