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

This commit is contained in:
unarist 2017-10-10 22:17:53 +09:00 committed by Eugen Rochko
parent 4a45cc7566
commit 9c448a0280

View file

@ -210,8 +210,10 @@ export default class Video extends React.PureComponent {
} }
handleProgress = () => { handleProgress = () => {
if (this.video.buffered.length > 0) {
this.setState({ buffer: this.video.buffered.end(0) / this.video.duration * 100 }); this.setState({ buffer: this.video.buffered.end(0) / this.video.duration * 100 });
} }
}
handleOpenVideo = () => { handleOpenVideo = () => {
this.video.pause(); this.video.pause();