wangliang_wd

feat:优化早晚报语音播报自动循环播放逻辑

... ... @@ -144,8 +144,26 @@ export struct MorningEveningPaperComponent {
}
}
EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => {
// console.log(TAG, 'this.currentStatus', val)
console.log(TAG, 'this.currentStatus', val)
this.currentStatus = val
if (this.currentStatus === 5) {
let audioIndex = 0
this.compInfoBean?.compList[0].audioDataList.forEach((item,index)=>{
if (item.audioUrl === this.audioPlayUrl) {
audioIndex = index + 1
}
})
///最后一个了
if (audioIndex === this.compInfoBean?.compList[0].audioDataList.length - 1) {
audioIndex = 0
}
this.audioPlayUrl = this.compInfoBean?.compList[0].audioDataList[audioIndex]?.audioUrl
this.audioTitle = this.compInfoBean?.compList[0].audioDataList[audioIndex]?.title
this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle)
}
})
}
... ...