diff --git a/src/components/video-preview/video-preview.jsx b/src/components/video-preview/video-preview.jsx index 2c9efce4c..05dedc82a 100644 --- a/src/components/video-preview/video-preview.jsx +++ b/src/components/video-preview/video-preview.jsx @@ -3,6 +3,7 @@ const PropTypes = require('prop-types'); const React = require('react'); const Video = require('../video/video.jsx'); +const Spinner = require('../spinner/spinner.jsx'); require('./video-preview.scss'); @@ -10,16 +11,25 @@ class VideoPreview extends React.Component { constructor (props) { super(props); bindAll(this, [ - 'handleShowVideo' + 'handleShowVideo', + 'handleVideoLoaded' ]); this.state = { - videoOpen: false + videoOpen: false, + spinnerVisible: false }; } handleShowVideo () { - this.setState({videoOpen: true}); + this.setState({ + videoOpen: true, + spinnerVisible: true + }); + } + + handleVideoLoaded () { + this.setState({spinnerVisible: false}); } render () { @@ -27,12 +37,16 @@ class VideoPreview extends React.Component {
{this.state.videoOpen ? ( -