audio组件Android bug
<Audio id= "audioDescription" name= "语音简介" author= "未知作者" src={getCdnUrl(detail.audioUrl)} controls={ false } loop={ false poster= "" /> <AtIcon prefixClass= "iconfont" value={isAudioPlaying ? 'shengyinwu' : 'shengyinkai' } className= "title--voice" size= "17" color= "#2696FF" onClick={ this .setAudioState.bind( this , !isAudioPlaying)} /> |
setAudioState(isAudioPlaying) { console.log(isAudioPlaying) // 音频 this .state.videoCtx.pause() this .state.videoCtx.seek(0) if (isAudioPlaying) { this .state.audioCtx.seek(0) this .state.audioCtx.play() } else { this .state.audioCtx.pause() } this .setState({ isAudioPlaying, isVideoPlaying: false }) } |
ios端一切正常,Android上面点击那个Icon无法控制audio组件
1 回复
1.6.0版本开始,该组件不再维护。建议使用能力更强的 wx.createInnerAudioContext 接口https://developers.weixin.qq.com/miniprogram/dev/component/audio.html