被听书组件打断时,设置播放icon状态
This commit is contained in:
@@ -103,9 +103,12 @@
|
||||
this.getTalkBookDetail()
|
||||
},
|
||||
onHide() {
|
||||
// console.log('onHide----',this.paused)
|
||||
this.audio.pause() // 暂停播放
|
||||
this.paused = false
|
||||
},
|
||||
onUnload() {
|
||||
// console.log('onUnload----',this.paused)
|
||||
this.audio.destroy() // 销毁播放器
|
||||
},
|
||||
computed: {
|
||||
@@ -121,6 +124,10 @@
|
||||
this.duration = this.audio.duration.toFixed()
|
||||
this.currentTime = this.audio.currentTime.toFixed()
|
||||
})
|
||||
this.audio.onPause(()=>{ // 用于被听书组件打断时,设置播放icon状态
|
||||
this.paused = false
|
||||
// console.log('onPause----------',this.paused)
|
||||
})
|
||||
this.paused = this.audio.paused
|
||||
// console.log('paused',this.paused)
|
||||
if(this.paused){
|
||||
|
||||
Reference in New Issue
Block a user