Fix bug when clicking on video position slider before starting the video

This commit is contained in:
Thibaut Girka 2018-08-14 15:19:40 +02:00 committed by ThibG
parent 2f73a9358e
commit 99b2e034c2

View file

@ -179,8 +179,10 @@ export default class Video extends React.PureComponent {
const { x } = getPointerPosition(this.seek, e);
const currentTime = Math.floor(this.video.duration * x);
this.video.currentTime = currentTime;
this.setState({ currentTime });
if (!isNaN(currentTime)) {
this.video.currentTime = currentTime;
this.setState({ currentTime });
}
}, 60);
togglePlay = () => {