-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React, { PropTypes } from 'react'; | ||
import autoBind from 'autobind-decorator'; | ||
import pureRender from 'pure-render-decorator'; | ||
import ImmutablePropTypes from 'react-immutable-proptypes'; | ||
import immutable from 'immutable'; | ||
|
||
@pureRender | ||
class PreVideo extends React.Component { | ||
static propTypes = { | ||
data: ImmutablePropTypes.map, | ||
id: PropTypes.number | ||
}; | ||
constructor(props){ | ||
super(props); | ||
} | ||
render() { | ||
var video; | ||
var style = {}; | ||
const { data } = this.props; | ||
let jsdata = data.toJS(); | ||
style = { | ||
paddingTop: jsdata.padding[0], | ||
paddingRight: jsdata.padding[1], | ||
paddingBottom: jsdata.padding[2], | ||
paddingLeft: jsdata.padding[3] | ||
}; | ||
video = (function(){ | ||
if(jsdata.auto && jsdata.loop){ | ||
return <video src={jsdata.address} x-webkit-airplay="allow" webkit-playsinline="true" preload controls frontend width="100%" autoPlay loop></video> | ||
}else if(!jsdata.auto && jsdata.loop){ | ||
return <video src={jsdata.address} x-webkit-airplay="allow" webkit-playsinline="true" preload controls frontend width="100%" loop></video> | ||
}else if(jsdata.auto && !jsdata.loop){ | ||
return <video src={jsdata.address} x-webkit-airplay="allow" webkit-playsinline="true" preload controls frontend width="100%" autoPlay></video> | ||
}else{ | ||
return <video src={jsdata.address} x-webkit-airplay="allow" webkit-playsinline="true" preload controls frontend width="100%"></video> | ||
} | ||
})(); | ||
return ( | ||
!!jsdata.address? | ||
<section className="m-video" style={style}> | ||
{video} | ||
</section> | ||
: null | ||
) | ||
} | ||
} | ||
export default PreVideo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters