Benjy Cui
9 years ago
7 changed files with 62 additions and 53 deletions
@ -0,0 +1,24 @@ |
|||
import React from 'react'; |
|||
import SublimeVideo from 'react-sublime-video'; |
|||
|
|||
export default class VideoPlayer extends React.Component { |
|||
render() { |
|||
const video = this.props.video; |
|||
const span = document.createElement('span'); |
|||
span.innerHTML = video; |
|||
const attributes = span.children[0].attributes; |
|||
const { alt, description, src } = attributes; |
|||
const videoClassName = attributes.class.nodeValue; |
|||
|
|||
return ( |
|||
<div className={`preview-image-box ${videoClassName}`}> |
|||
<div className={'preview-image-wrapper'}> |
|||
<SublimeVideo src={src && src.nodeValue} type="video/mp4" /> |
|||
</div> |
|||
<div className="preview-image-title">{alt && alt.nodeValue}</div> |
|||
<div className="preview-image-description" |
|||
dangerouslySetInnerHTML={{ __html: description && description.nodeValue }} /> |
|||
</div> |
|||
); |
|||
} |
|||
} |
@ -1,21 +0,0 @@ |
|||
import Motion from './motion'; |
|||
|
|||
module.exports = function () { |
|||
Motion.motionVideo.init([ |
|||
'https://os.alipayobjects.com/rmsportal/EejaUGsyExkXyXr.mp4', |
|||
'https://os.alipayobjects.com/rmsportal/GIutPgZMTyfFfrH.mp4', |
|||
'https://os.alipayobjects.com/rmsportal/ERKhqHlcHiCDSQu.mp4', |
|||
'https://os.alipayobjects.com/rmsportal/FqkQMyFqNqielOw.mp4', |
|||
'https://os.alipayobjects.com/rmsportal/pnNkNIMoowmGUQy.mp4', |
|||
'https://os.alipayobjects.com/rmsportal/XrUIWmsmOlEnZGc.mp4', |
|||
'https://os.alipayobjects.com/rmsportal/gSNilqbiXOufDXF.mp4', |
|||
], [ |
|||
'https://os.alipayobjects.com/rmsportal/EejaUGsyExkXyXr.mp4', |
|||
'https://os.alipayobjects.com/rmsportal/GIutPgZMTyfFfrH.mp4', |
|||
'https://os.alipayobjects.com/rmsportal/ERKhqHlcHiCDSQu.mp4', |
|||
'https://os.alipayobjects.com/rmsportal/FqkQMyFqNqielOw.mp4', |
|||
'https://os.alipayobjects.com/rmsportal/pnNkNIMoowmGUQy.mp4', |
|||
'https://os.alipayobjects.com/rmsportal/XrUIWmsmOlEnZGc.mp4', |
|||
'https://os.alipayobjects.com/rmsportal/gSNilqbiXOufDXF.mp4', |
|||
]); |
|||
}; |
Loading…
Reference in new issue