Using video-react package for video, when we initially seek the player not working properly in safari?

481 Views Asked by At

When we initially seek the player start time to any other seconds other than 00:00:00 the player gets started at 00:00:00 second and after playing to 00:00:01 sec or fewer it seek to proper seconds that we provided to start the video. It is happening in safari browser. We are using video-react package for this.

code for player

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

When clicking on play button startIntro() following function called,

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

There are 1 best solutions below

0
davidfurber On

Are there error messages or does it fail silently? I have the latter problem. However, the video react instructions suggest you should set the player ref like this:

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