diff options
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/components/components/video_player.jsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/components/video_player.jsx b/app/assets/javascripts/components/components/video_player.jsx index 61c1995a7..8f64ad3cd 100644 --- a/app/assets/javascripts/components/components/video_player.jsx +++ b/app/assets/javascripts/components/components/video_player.jsx @@ -53,7 +53,8 @@ const VideoPlayer = React.createClass({ propTypes: { media: ImmutablePropTypes.map.isRequired, width: React.PropTypes.number, - height: React.PropTypes.number + height: React.PropTypes.number, + sensitive: React.PropTypes.bool }, getDefaultProps () { @@ -102,6 +103,12 @@ const VideoPlayer = React.createClass({ <span style={spoilerSubSpanStyle}><FormattedMessage id='status.sensitive_toggle' defaultMessage='Click to view' /></span> </div> ); + } else if (!sensitive && !this.state.visible) { + return ( + <div style={{ cursor: 'pointer', position: 'relative', marginTop: '8px', width: `${width}px`, height: `${height}px`, background: `url(${media.get('preview_url')}) no-repeat center`, backgroundSize: 'cover' }} onClick={this.handleOpen}> + <div style={{ position: 'absolute', top: '50%', left: '50%', fontSize: '36px', transform: 'translate(-50%, -50%)', padding: '5px', borderRadius: '100px', color: 'rgba(255, 255, 255, 0.8)' }}><i className='fa fa-play' /></div> + </div> + ); } return ( |