about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/video/index.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-08-14 15:19:40 +0200
committerThibG <thib@sitedethib.com>2018-08-14 21:56:23 +0200
commitc4e8402ef9d8e0832347cf06b79ba57cfd9f0526 (patch)
treed3635a4f68720e17ee851eed58f14d50a9ea91f3 /app/javascript/flavours/glitch/features/video/index.js
parentf0fa6e3a7c4859d52b163b5c2e3389e72c4efd4c (diff)
Fix bug when clicking on video position slider before starting the video
Diffstat (limited to 'app/javascript/flavours/glitch/features/video/index.js')
-rw-r--r--app/javascript/flavours/glitch/features/video/index.js6
1 files 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 d9c59c677..4823ac274 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 = () => {