diff options
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/post_view/components/post_body_additional_content.jsx | 1 | ||||
-rw-r--r-- | webapp/components/youtube_video.jsx | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/webapp/components/post_view/components/post_body_additional_content.jsx b/webapp/components/post_view/components/post_body_additional_content.jsx index d7cbe5d6c..0ab015ced 100644 --- a/webapp/components/post_view/components/post_body_additional_content.jsx +++ b/webapp/components/post_view/components/post_body_additional_content.jsx @@ -81,6 +81,7 @@ export default class PostBodyAdditionalContent extends React.Component { <YoutubeVideo channelId={this.props.post.channel_id} link={link} + show={this.state.embedVisible} /> ); } diff --git a/webapp/components/youtube_video.jsx b/webapp/components/youtube_video.jsx index 42b193612..a3e8765ae 100644 --- a/webapp/components/youtube_video.jsx +++ b/webapp/components/youtube_video.jsx @@ -46,6 +46,10 @@ export default class YoutubeVideo extends React.Component { return; } + if (props.show === false) { + this.stop(); + } + this.setState({ videoId: match[2], time: this.handleYoutubeTime(link) @@ -221,5 +225,6 @@ export default class YoutubeVideo extends React.Component { YoutubeVideo.propTypes = { channelId: React.PropTypes.string.isRequired, - link: React.PropTypes.string.isRequired + link: React.PropTypes.string.isRequired, + show: React.PropTypes.bool.isRequired }; |