stopped youtube videos upon collapsing (#3388)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
dd341de0ac
Коммит
eb76e61534
@@ -81,6 +81,7 @@ export default class PostBodyAdditionalContent extends React.Component {
|
|||||||
<YoutubeVideo
|
<YoutubeVideo
|
||||||
channelId={this.props.post.channel_id}
|
channelId={this.props.post.channel_id}
|
||||||
link={link}
|
link={link}
|
||||||
|
show={this.state.embedVisible}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ export default class YoutubeVideo extends React.Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (props.show === false) {
|
||||||
|
this.stop();
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
videoId: match[2],
|
videoId: match[2],
|
||||||
time: this.handleYoutubeTime(link)
|
time: this.handleYoutubeTime(link)
|
||||||
@@ -221,5 +225,6 @@ export default class YoutubeVideo extends React.Component {
|
|||||||
|
|
||||||
YoutubeVideo.propTypes = {
|
YoutubeVideo.propTypes = {
|
||||||
channelId: React.PropTypes.string.isRequired,
|
channelId: React.PropTypes.string.isRequired,
|
||||||
link: React.PropTypes.string.isRequired
|
link: React.PropTypes.string.isRequired,
|
||||||
|
show: React.PropTypes.bool.isRequired
|
||||||
};
|
};
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user