inner audio context 播放问题

发布于 6 年前作者 luoxiuying17762 次浏览最后编辑 6 年前来自 ask

const confimrSound = wx.createInnerAudioContext()

confimrSound.src = ‘/assets/audio/confirm.mp3’

confimrSound.play()

confimrSound.onPlay(() => {

    //这里就不运行

})

1 回复
fangpeng
fangpeng1 楼4 年前

const confimrSound = wx.createInnerAudioContext()

confimrSound.onPlay(() => // 调一下顺序

    //这里就不运行

})

confimrSound.src = '/assets/audio/confirm.mp3'

confimrSound.play()