summaryrefslogtreecommitdiffstats
path: root/webapp/components/youtube_video.jsx
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-05-26 09:49:09 -0300
committerChristopher Speller <crspeller@gmail.com>2016-05-26 08:49:09 -0400
commit21e4bc7c42f5bebe81255656dc87e14c973a6865 (patch)
tree994a71d78c6cf57431c25344f2224068e37f11ea /webapp/components/youtube_video.jsx
parente5ec6c95b597b6c8cde82091d1e13b9e8d34c484 (diff)
downloadchat-21e4bc7c42f5bebe81255656dc87e14c973a6865.tar.gz
chat-21e4bc7c42f5bebe81255656dc87e14c973a6865.tar.bz2
chat-21e4bc7c42f5bebe81255656dc87e14c973a6865.zip
PLT-3049 Revert Google Api Key to show YouTube Previews (#3116)
Diffstat (limited to 'webapp/components/youtube_video.jsx')
-rw-r--r--webapp/components/youtube_video.jsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/webapp/components/youtube_video.jsx b/webapp/components/youtube_video.jsx
index 35b25e002..dc2d368d7 100644
--- a/webapp/components/youtube_video.jsx
+++ b/webapp/components/youtube_video.jsx
@@ -16,6 +16,7 @@ export default class YoutubeVideo extends React.Component {
this.updateStateFromProps = this.updateStateFromProps.bind(this);
this.handleReceivedMetadata = this.handleReceivedMetadata.bind(this);
this.handleMetadataError = this.handleMetadataError.bind(this);
+ this.loadWithoutKey = this.loadWithoutKey.bind(this);
this.play = this.play.bind(this);
this.stop = this.stop.bind(this);
@@ -85,9 +86,15 @@ export default class YoutubeVideo extends React.Component {
if (key) {
WebClient.getYoutubeVideoInfo(key, this.state.videoId,
this.handleReceivedMetadata, this.handleMetadataError);
+ } else {
+ this.loadWithoutKey();
}
}
+ loadWithoutKey() {
+ this.setState({loaded: true});
+ }
+
handleMetadataError() {
this.setState({
failed: true,
@@ -133,10 +140,6 @@ export default class YoutubeVideo extends React.Component {
}
render() {
- if (!global.window.mm_config.GoogleDeveloperKey) {
- return <div/>;
- }
-
if (!this.state.loaded) {
return <div className='video-loading'/>;
}