Browse Source

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

closed-social-glitch-2
Thibaut Girka 6 years ago
committed by ThibG
parent
commit
c4e8402ef9
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      app/javascript/flavours/glitch/features/video/index.js

+ 4
- 2
app/javascript/flavours/glitch/features/video/index.js 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 = () => {

Loading…
Cancel
Save