about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/video/index.js
diff options
context:
space:
mode:
authorunarist <m.unarist@gmail.com>2017-10-10 22:17:53 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-10-10 15:17:53 +0200
commit784c7510d762f9c7206812abeade03d8f4afa611 (patch)
treef0b791c2a48fcd5bc6f4322980b58e5c454d6ee2 /app/javascript/mastodon/features/video/index.js
parent6c54d2e5837de941457371e9afffd05606d88180 (diff)
Fix an error when video playback buffer is empty (#5300)
Diffstat (limited to 'app/javascript/mastodon/features/video/index.js')
-rw-r--r--app/javascript/mastodon/features/video/index.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/video/index.js b/app/javascript/mastodon/features/video/index.js
index 8b83fb66b..003bf23a8 100644
--- a/app/javascript/mastodon/features/video/index.js
+++ b/app/javascript/mastodon/features/video/index.js
@@ -210,7 +210,9 @@ export default class Video extends React.PureComponent {
   }
 
   handleProgress = () => {
-    this.setState({ buffer: this.video.buffered.end(0) / this.video.duration * 100 });
+    if (this.video.buffered.length > 0) {
+      this.setState({ buffer: this.video.buffered.end(0) / this.video.duration * 100 });
+    }
   }
 
   handleOpenVideo = () => {