0

当我们最初将播放器开始时间寻找到 00:00:00 以外的任何其他秒时,播放器在 00:00:00 秒开始,在播放到 00:00:01 秒或更短时间后,它会寻找我们提供的适当秒数开始播放视频。它发生在 safari 浏览器中。我们为此使用了video-react包。

播放器代码

<Player
    ref="player"
    playsInline
    startTime={videoStartTime}
    src={subject && subject.clipUrl}
    onLoadStart={() => {
        this.setState({
            isLoading: false,
        })
     }}
     onLoadedData={() => {
         this.setState({
             isLoading: true,
          })
     }}
 >
</player>   

当点击播放按钮 startIntro() 以下函数调用时,

startIntro = () => {
    introStart = 500;
    this.setState({
      videoStartTime: introStart,
    })
    this.refs.player.seek(introStart);
    this.refs.player.play();
}
4

1 回答 1

1

是否有错误消息或它是否静默失败?我有后一个问题。但是,视频反应说明建议您应该像这样设置播放器参考:

ref={player => this.player = player}

于 2021-02-25T18:59:51.847 回答