aboutsummaryrefslogtreecommitdiff
path: root/src/client/DocServer.ts
diff options
context:
space:
mode:
authorStanley Yip <33562077+yipstanley@users.noreply.github.com>2019-07-30 19:41:00 -0400
committerGitHub <noreply@github.com>2019-07-30 19:41:00 -0400
commita2a73a1ad032979ea6eea06aa65354841e0ef0fa (patch)
tree00e38b12a22dcc52253e2d7c3e35efee42ad80cf /src/client/DocServer.ts
parentc53d5fb0e5162cf27d6b5e5ed0ceb35f2461302e (diff)
parent80e6356692da7bffaad2efccf01500173c488de0 (diff)
Merge branch 'master' into text_box_ab
Diffstat (limited to 'src/client/DocServer.ts')
-rw-r--r--src/client/DocServer.ts16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts
index cb460799f..258acd9cd 100644
--- a/src/client/DocServer.ts
+++ b/src/client/DocServer.ts
@@ -1,5 +1,5 @@
import * as OpenSocket from 'socket.io-client';
-import { MessageStore, Diff } from "./../server/Message";
+import { MessageStore, Diff, YoutubeQueryTypes } from "./../server/Message";
import { Opt } from '../new_fields/Doc';
import { Utils, emptyFunction } from '../Utils';
import { SerializationHelper } from './util/SerializationHelper';
@@ -156,6 +156,20 @@ export namespace DocServer {
return _GetRefField(id);
}
+ export async function getYoutubeChannels() {
+ let apiKey = await Utils.EmitCallback(_socket, MessageStore.YoutubeApiQuery, { type: YoutubeQueryTypes.Channels });
+ return apiKey;
+ }
+
+ export function getYoutubeVideos(videoTitle: string, callBack: (videos: any[]) => void) {
+ Utils.EmitCallback(_socket, MessageStore.YoutubeApiQuery, { type: YoutubeQueryTypes.SearchVideo, userInput: videoTitle }, callBack);
+ }
+
+ export function getYoutubeVideoDetails(videoIds: string, callBack: (videoDetails: any[]) => void) {
+ Utils.EmitCallback(_socket, MessageStore.YoutubeApiQuery, { type: YoutubeQueryTypes.VideoDetails, videoIds: videoIds }, callBack);
+ }
+
+
/**
* Given a list of Doc GUIDs, this utility function will asynchronously attempt to each id's associated
* field, first looking in the RefField cache and then communicating with