logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 784c7510d762f9c7206812abeade03d8f4afa611
parent: 6c54d2e5837de941457371e9afffd05606d88180
Author: unarist <m.unarist@gmail.com>
Date:   Tue, 10 Oct 2017 22:17:53 +0900

Fix an error when video playback buffer is empty (#5300)


Diffstat:

Mapp/javascript/mastodon/features/video/index.js4+++-
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 @@ -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 = () => {