PLT 783 Fix Previews for removed YouTube videos (#3073)
* PLT-783 Fix Previews for removed YouTube videos render incorrectly and throw a 404 * Updating video poster for video not found (#3072)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
2a137e97c4
Коммит
ed2e37394e
@@ -6,6 +6,8 @@ import TeamStore from '../stores/team_store.jsx';
|
||||
import BrowserStore from '../stores/browser_store.jsx';
|
||||
import * as GlobalActions from 'action_creators/global_actions.jsx';
|
||||
|
||||
import request from 'superagent';
|
||||
|
||||
const HTTP_UNAUTHORIZED = 401;
|
||||
|
||||
class WebClientClass extends Client {
|
||||
@@ -82,6 +84,17 @@ class WebClientClass extends Client {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
getYoutubeVideoInfo(googleKey, videoId, success, error) {
|
||||
request.get('https://www.googleapis.com/youtube/v3/videos').
|
||||
query({part: 'snippet', id: videoId, key: googleKey}).
|
||||
end((err, res) => {
|
||||
if (err) {
|
||||
return error(err);
|
||||
}
|
||||
return success(res.body);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var WebClient = new WebClientClass();
|
||||
|
||||
Ссылка в новой задаче
Block a user