stopped youtube videos upon collapsing (#3388)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
dd341de0ac
Коммит
eb76e61534
@@ -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
|
||||
};
|
||||
|
||||
Ссылка в новой задаче
Block a user