summaryrefslogtreecommitdiffstats
path: root/webapp/utils/web_client.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/utils/web_client.jsx')
-rw-r--r--webapp/utils/web_client.jsx13
1 files changed, 13 insertions, 0 deletions
diff --git a/webapp/utils/web_client.jsx b/webapp/utils/web_client.jsx
index 04fba0c5b..f6e2d6ac5 100644
--- a/webapp/utils/web_client.jsx
+++ b/webapp/utils/web_client.jsx
@@ -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();