Switch to MediaElement (all done except letterboxing)
This commit is contained in:
parent
5f5e3ae5c6
commit
986a2bf16e
6 changed files with 18 additions and 31 deletions
4
dist/index.html
vendored
4
dist/index.html
vendored
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
<link href='https://fonts.googleapis.com/css?family=Raleway:600,300' rel='stylesheet' type='text/css'>
|
<link href='https://fonts.googleapis.com/css?family=Raleway:600,300' rel='stylesheet' type='text/css'>
|
||||||
<link href="./css/all.css" rel="stylesheet" type="text/css" media="screen,print" />
|
<link href="./css/all.css" rel="stylesheet" type="text/css" media="screen,print" />
|
||||||
|
<link href="./js/mediaelement/mediaelementplayer.css" rel="stylesheet" type="text/css" />
|
||||||
<link rel="icon" type="image/png" href="./img/fav/favicon-32x32.png" sizes="32x32">
|
<link rel="icon" type="image/png" href="./img/fav/favicon-32x32.png" sizes="32x32">
|
||||||
<link rel="icon" type="image/png" href="./img/fav/favicon-194x194.png" sizes="194x194">
|
<link rel="icon" type="image/png" href="./img/fav/favicon-194x194.png" sizes="194x194">
|
||||||
<link rel="icon" type="image/png" href="./img/fav/favicon-96x96.png" sizes="96x96">
|
<link rel="icon" type="image/png" href="./img/fav/favicon-96x96.png" sizes="96x96">
|
||||||
|
@ -21,7 +22,8 @@
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.6/react.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.6/react.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.6/react-dom.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.6/react-dom.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.7.4/polyfill.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.7.4/polyfill.js"></script>
|
||||||
<script src="./js/flowplayer/flowplayer-3.2.13.min.js"></script>
|
<script src="./js/mediaelement/jquery.js"></script>
|
||||||
|
<script src="./js/mediaelement/mediaelement-and-player.min.js"></script>
|
||||||
<script src="./js/lbry.js"></script>
|
<script src="./js/lbry.js"></script>
|
||||||
<script src="./js/component/common.js"></script>
|
<script src="./js/component/common.js"></script>
|
||||||
<script src="./js/component/splash.js"></script>
|
<script src="./js/component/splash.js"></script>
|
||||||
|
|
22
dist/js/flowplayer/flowplayer-3.2.13.min.js
vendored
22
dist/js/flowplayer/flowplayer-3.2.13.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/js/flowplayer/flowplayer-3.2.18.swf
vendored
BIN
dist/js/flowplayer/flowplayer-3.2.18.swf
vendored
Binary file not shown.
BIN
dist/js/flowplayer/flowplayer.controls-3.2.16.swf
vendored
BIN
dist/js/flowplayer/flowplayer.controls-3.2.16.swf
vendored
Binary file not shown.
|
@ -1,7 +1,6 @@
|
||||||
var videoStyle = {
|
var videoStyle = {
|
||||||
width: '100%',
|
maxWidth: '100%',
|
||||||
// height: '100%',
|
maxHeight: '100%',
|
||||||
backgroundColor: '#000'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var WatchPage = React.createClass({
|
var WatchPage = React.createClass({
|
||||||
|
@ -13,6 +12,7 @@ var WatchPage = React.createClass({
|
||||||
downloadStarted: false,
|
downloadStarted: false,
|
||||||
readyToPlay: false,
|
readyToPlay: false,
|
||||||
loadStatusMessage: "Requesting stream",
|
loadStatusMessage: "Requesting stream",
|
||||||
|
mimeType: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
|
@ -31,20 +31,26 @@ var WatchPage = React.createClass({
|
||||||
setTimeout(() => { this.updateLoadStatus() }, 250);
|
setTimeout(() => { this.updateLoadStatus() }, 250);
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
readyToPlay: true
|
readyToPlay: true,
|
||||||
|
mimeType: status.mime_type,
|
||||||
})
|
})
|
||||||
flowplayer('player', 'js/flowplayer/flowplayer-3.2.18.swf');
|
var player = new MediaElementPlayer('#player', {
|
||||||
|
mode: 'shim', // Force Flash (for now)
|
||||||
|
// enableAutosize: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
return (
|
return (
|
||||||
<main className="page full-width">
|
<main className="page full-screen">
|
||||||
<div className={this.state.readyToPlay ? 'hidden' : ''}>
|
<div className={this.state.readyToPlay ? 'hidden' : ''}>
|
||||||
<h3>Loading lbry://{this.props.name}</h3>
|
<h3>Loading lbry://{this.props.name}</h3>
|
||||||
{this.state.loadStatusMessage}...
|
{this.state.loadStatusMessage}...
|
||||||
</div>
|
</div>
|
||||||
<a id="player" href={"/view?name=" + this.props.name} style={videoStyle} />
|
<video id="player" style={videoStyle} width="100%" height="100%">
|
||||||
|
<source type={this.state.mimeType} src={"/view?name=" + this.props.name} />
|
||||||
|
</video>
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,9 @@ body
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
width: 800px;
|
width: 800px;
|
||||||
|
|
||||||
&.full-width {
|
&.full-screen {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue