hookehuyr

fix 修复音频播放显示问题

......@@ -272,6 +272,7 @@ var spotInfo = [
name: '观音殿',
note: '',
url: 'https://mp.weixin.qq.com/s/-b29FEPxZyE3Lu1KucmPcw',
audio: '',
},
],
},
......
......@@ -93,20 +93,24 @@ export default {
},
infoWindow(val) {
if (val) {
// 存放到pinia里面控制
this.changeAudio(this.audio);
// 加载录音
this.audio.src = this.info?.details[this.isActive]['audio'];
let play_status = this.audio.play() // 播放
if (play_status) {
play_status.then(() => {
// 音频的播放需要耗时
this.audio.pause();
this.play_time = this.getAudioTime(this.audio.duration)
}).catch((e) => {
// 失败
console.log('Operation is too fast, audio play fails')
})
if (this.info?.details[this.isActive]['audio']) {
// 存放到pinia里面控制
this.changeAudio(this.audio);
this.changeAudioStatus('pause');
// 加载录音
this.audio.src = this.info?.details[this.isActive]['audio'];
let play_status = this.audio.play() // 播放
if (play_status) {
play_status.then(() => {
// 音频的播放需要耗时
this.is_play = false;
this.audio.pause();
this.play_time = this.getAudioTime(this.audio.duration)
}).catch((e) => {
// 失败
console.log('Operation is too fast, audio play fails')
})
}
}
}
},
......