diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-08-14 15:19:40 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2018-08-14 21:56:23 +0200 |
commit | c4e8402ef9d8e0832347cf06b79ba57cfd9f0526 (patch) | |
tree | d3635a4f68720e17ee851eed58f14d50a9ea91f3 /app | |
parent | f0fa6e3a7c4859d52b163b5c2e3389e72c4efd4c (diff) |
Fix bug when clicking on video position slider before starting the video
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/flavours/glitch/features/video/index.js | 6 |
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 = () => { |