From c4e8402ef9d8e0832347cf06b79ba57cfd9f0526 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Tue, 14 Aug 2018 15:19:40 +0200 Subject: [PATCH] Fix bug when clicking on video position slider before starting the video --- app/javascript/flavours/glitch/features/video/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/features/video/index.js b/app/javascript/flavours/glitch/features/video/index.js index d9c59c677a..4823ac274f 100644 --- a/app/javascript/flavours/glitch/features/video/index.js +++ b/app/javascript/flavours/glitch/features/video/index.js @@ -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 = () => {