How to seekTo on componentDidMount
xpluscal opened this issue · 1 comments
xpluscal commented
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
souporserious commented
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.