2016-03-16 17:46:35 +08:00
|
|
|
import React from 'react';
|
|
|
|
import SublimeVideo from 'react-sublime-video';
|
|
|
|
|
|
|
|
export default class VideoPlayer extends React.Component {
|
|
|
|
render() {
|
|
|
|
const video = this.props.video;
|
2016-04-06 16:14:00 +08:00
|
|
|
const { alt, description, src } = video;
|
|
|
|
const videoClassName = video.class;
|
2016-03-16 17:46:35 +08:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={`preview-image-box ${videoClassName}`}>
|
|
|
|
<div className={'preview-image-wrapper'}>
|
2016-04-06 16:14:00 +08:00
|
|
|
<SublimeVideo src={src} type="video/mp4" />
|
2016-03-16 17:46:35 +08:00
|
|
|
</div>
|
2016-04-06 16:14:00 +08:00
|
|
|
<div className="preview-image-title">{alt}</div>
|
2016-03-16 17:46:35 +08:00
|
|
|
<div className="preview-image-description"
|
2016-04-06 16:14:00 +08:00
|
|
|
dangerouslySetInnerHTML={{ __html: description }} />
|
2016-03-16 17:46:35 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|