PLT-3049 Revert Google Api Key to show YouTube Previews (#3116)

This commit is contained in:
enahum
2016-05-26 09:49:09 -03:00
committed by Christopher Speller
parent e5ec6c95b5
commit 21e4bc7c42

View File

@@ -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'/>;
}