Make 15 sec fallback loop start when video is created, loop properly
This commit is contained in:
parent
5870f42ab3
commit
d3745e13d1
1 changed files with 1 additions and 2 deletions
|
@ -18,14 +18,13 @@ var WatchPage = React.createClass({
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
lbry.getStream(this.props.name);
|
lbry.getStream(this.props.name);
|
||||||
this.updateLoadStatus();
|
this.updateLoadStatus();
|
||||||
setTimeout(() => { this.reloadIfNeeded() }, 15000);
|
|
||||||
},
|
},
|
||||||
reloadIfNeeded: function() {
|
reloadIfNeeded: function() {
|
||||||
// Fallback option for loading problems: every 15 seconds, if the video hasn't reported being
|
// Fallback option for loading problems: every 15 seconds, if the video hasn't reported being
|
||||||
// playable yet, ask it to reload.
|
// playable yet, ask it to reload.
|
||||||
if (!this.state.readyToPlay) {
|
if (!this.state.readyToPlay) {
|
||||||
console.log("Trying again");
|
|
||||||
this._video.load()
|
this._video.load()
|
||||||
|
setTimeout(() => { this.reloadIfNeeded() }, 15000);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onCanPlay: function() {
|
onCanPlay: function() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue