mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-3049 Revert Google Api Key to show YouTube Previews (#3116)
This commit is contained in:
committed by
Christopher Speller
parent
e5ec6c95b5
commit
21e4bc7c42
@@ -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'/>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user