From 9c448a0280213e516574d9962e7c53f7c3c41088 Mon Sep 17 00:00:00 2001 From: unarist Date: Tue, 10 Oct 2017 22:17:53 +0900 Subject: [PATCH] Fix an error when video playback buffer is empty (#5300) --- app/javascript/mastodon/features/video/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/features/video/index.js b/app/javascript/mastodon/features/video/index.js index 8b83fb66ba..003bf23a84 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 = () => {