react-media-player icon indicating copy to clipboard operation
react-media-player copied to clipboard

How to seekTo on componentDidMount

Open xpluscal opened this issue 8 years ago • 1 comments

Hi,

I'd like to seekTo a certain time when my Media component ist loaded. I do not use a custom player, but this:

export default MediaPlayer = withMediaProps(withMediaPlayer(MediaPlayer));

and inside the MediaPlayer component I use this to seekTo the time set via Redux:

componentDidMount(){
    let that = this;
    if(this.props.startTime && this.props.media){
      that.props.media.seekTo(that.props.startTime);
    }
  }

Any ideas what could be wrong? Thanks

xpluscal avatar Dec 06 '16 09:12 xpluscal

Sorry, I just saw this issue. Can you provide anymore code? Maybe the whole component so I can get an idea of what's going on? I've been thinking about adding a startTime prop or something similar to define when the video should start playing similar to how Youtube allows you to set a start time.

souporserious avatar Jan 25 '17 04:01 souporserious