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
@@ -682,7 +682,7 @@ export function applyTheme(theme) {
|
||||
changeCss('.app__body .post-list__arrows', 'fill:' + changeOpacity(theme.centerChannelColor, 0.3), 1);
|
||||
changeCss('.app__body .sidebar--left, .app__body .sidebar--right .sidebar--right__header, .app__body .suggestion-list__content .command', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
|
||||
changeCss('.app__body .app__content, .app__body .post-create__container .post-create-body .btn-file, .app__body .post-create__container .post-create-footer .msg-typing, .app__body .suggestion-list__content .command, .app__body .modal .modal-content, .app__body .dropdown-menu, .app__body .popover, .app__body .mentions__name, .app__body .tip-overlay', 'color:' + theme.centerChannelColor, 1);
|
||||
changeCss('.app__body #archive-link-home', 'background:' + changeOpacity(theme.centerChannelColor, 0.15), 1);
|
||||
changeCss('.app__body #archive-link-home, .video-div .video-thumbnail__error', 'background:' + changeOpacity(theme.centerChannelColor, 0.15), 1);
|
||||
changeCss('.app__body #post-create', 'color:' + theme.centerChannelColor, 2);
|
||||
changeCss('.app__body .mentions--top, .app__body .suggestion-list', 'box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 3);
|
||||
changeCss('.app__body .mentions--top, .app__body .suggestion-list', '-webkit-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 2);
|
||||
|
||||
@@ -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