diff options
-rw-r--r-- | webapp/components/youtube_video.jsx | 11 |
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'/>; } |