summaryrefslogtreecommitdiffstats
path: root/webapp/components/youtube_video.jsx
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-06-21 21:21:40 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-06-21 21:21:40 -0400
commiteb76e61534742b126a35afe12da1deb9c4f8a7d6 (patch)
treefa91f8b23fb5fc0abf20f885c923ecbf39494327 /webapp/components/youtube_video.jsx
parentdd341de0ac091a525744fff69ed79f11700690e4 (diff)
downloadchat-eb76e61534742b126a35afe12da1deb9c4f8a7d6.tar.gz
chat-eb76e61534742b126a35afe12da1deb9c4f8a7d6.tar.bz2
chat-eb76e61534742b126a35afe12da1deb9c4f8a7d6.zip
stopped youtube videos upon collapsing (#3388)
Diffstat (limited to 'webapp/components/youtube_video.jsx')
-rw-r--r--webapp/components/youtube_video.jsx7
1 files changed, 6 insertions, 1 deletions
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
};