mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
stopped youtube videos upon collapsing (#3388)
This commit is contained in:
@@ -81,6 +81,7 @@ export default class PostBodyAdditionalContent extends React.Component {
|
||||
<YoutubeVideo
|
||||
channelId={this.props.post.channel_id}
|
||||
link={link}
|
||||
show={this.state.embedVisible}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user