Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
map-demo
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2023-06-12 15:40:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d84f76a28b3031bfd9fcc281f81d986f2acf315c
d84f76a2
1 parent
a40a6b58
fix 修复音频播放显示问题
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
src/common/tiantan_v2.js
src/components/InfoWindow.vue
src/common/tiantan_v2.js
View file @
d84f76a
...
...
@@ -272,6 +272,7 @@ var spotInfo = [
name
:
'观音殿'
,
note
:
''
,
url
:
'https://mp.weixin.qq.com/s/-b29FEPxZyE3Lu1KucmPcw'
,
audio
:
''
,
},
],
},
...
...
src/components/InfoWindow.vue
View file @
d84f76a
...
...
@@ -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')
})
}
}
}
},
...
...
Please
register
or
login
to post a comment