From: unarist Date: Tue, 10 Oct 2017 13:17:53 +0000 (+0900) Subject: Fix an error when video playback buffer is empty (#5300) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=784c7510d762f9c7206812abeade03d8f4afa611;p=mastodon.git Fix an error when video playback buffer is empty (#5300) --- 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 = () => {