收藏
回答

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组件


最后一次编辑于  04-15
回答关注问题邀请回答
收藏

1 个回答