audio组件Android bug
发布于 5 年前 作者 qiangkang 2315 次浏览 来自 问答
<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 回复
回到顶部