Home.js (1307B)
1 /** 2 * React Starter Kit (https://www.reactstarterkit.com/) 3 * 4 * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 * 6 * This source code is licensed under the MIT license found in the 7 * LICENSE.txt file in the root directory of this source tree. 8 */ 9 10 import React, { PropTypes } from 'react'; 11 import withStyles from 'isomorphic-style-loader/lib/withStyles'; 12 import s from './Home.css'; 13 import VideoPlayer from '../../components/VideoJs/VideoJs'; 14 15 class Home extends React.Component { 16 static propTypes = { 17 news: PropTypes.arrayOf(PropTypes.shape({ 18 title: PropTypes.string.isRequired, 19 link: PropTypes.string.isRequired, 20 content: PropTypes.string, 21 })).isRequired, 22 }; 23 24 render() { 25 const videoJsOptions = { 26 autoplay: false, 27 controls: true, 28 sources: [{ 29 src: 'http://vjs.zencdn.net/v/oceans.mp4', 30 type: 'video/mp4', 31 }, 32 { 33 src: 'https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8', 34 type: 'application/x-mpegURL', 35 }, 36 ], 37 }; 38 return ( 39 <div className={s.root}> 40 <div className={s.container}> 41 <h1>Live Streams</h1> 42 <VideoPlayer {...videoJsOptions} /> 43 </div> 44 </div> 45 ); 46 } 47 } 48 49 export default withStyles(s)(Home);