Remove video ready state poll (video now starts on first try)
This commit is contained in:
parent
54a125673e
commit
b9d30cf85e
1 changed files with 2 additions and 11 deletions
|
@ -8,20 +8,11 @@ var WatchPage = React.createClass({
|
|||
propTypes: {
|
||||
name: React.PropTypes.string,
|
||||
},
|
||||
updateVideo: function(video, firstRun=true) {
|
||||
if (!video.readyState) {
|
||||
if (!firstRun) { // On the first run, give the browser's initial load a chance to work
|
||||
video.load();
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.updateVideo(video, false);
|
||||
}, 3000);
|
||||
}
|
||||
},
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
<main>
|
||||
<video style={videoStyle} src={"/view?name=" + this.props.name} ref={this.updateVideo} controls></video>
|
||||
<video style={videoStyle} src={"/view?name=" + this.props.name} controls />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue