Interface: Application
Properties
networkRequest
• networkRequest: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>
Type declaration
▸ (input, init?): Promise<Response>
Make a networkRequest from parent VideoGata frame rather from plugin frame.
Parameters
| Name | Type |
|---|---|
input | RequestInfo | URL |
init? | RequestInit |
Returns
Promise<Response>
Methods
addPlaylists
▸ addPlaylists(playlists): Promise<void>
Adds or updates playlists. Playlists with the same id are updated.
Parameters
| Name | Type |
|---|---|
playlists | Playlist[] |
Returns
Promise<void>
addVideosToPlaylist
▸ addVideosToPlaylist(playlistId, videos): Promise<void>
Adds videos to a playlist
Parameters
| Name | Type | Description |
|---|---|---|
playlistId | string | id of playlist |
videos | Video[] | Videos being added to playlist |
Returns
Promise<void>
createNotification
▸ createNotification(notification): Promise<void>
Show user a notification on the bottom left of the screen
Parameters
| Name | Type |
|---|---|
notification | NotificationMessage |
Returns
Promise<void>
endVideo
▸ endVideo(): Promise<void>
Used to signal that current video embedded in player has ended.
Remarks
This method must be called in order for VideoGata to determine when to go to the next video in a playlist.
Returns
Promise<void>
getCorsProxy
▸ getCorsProxy(): Promise<undefined | string>
Get cors proxy configured in settings.
Returns
Promise<undefined | string>
getLocale
▸ getLocale(): Promise<string>
Get locale configured in settings.
Returns
Promise<string>
getPlaylists
▸ getPlaylists(): Promise<Playlist[]>
Get the user's current playlists.
Returns
Promise<Playlist[]>
getPlaylistsInfo
▸ getPlaylistsInfo(): Promise<PlaylistInfo[]>
Get the users's current playlists metadata without tracks.
Returns
Promise<PlaylistInfo[]>
getPluginId
▸ getPluginId(): Promise<string>
Get the current plugin's id.
Returns
Promise<string>
getPlugins
▸ getPlugins(): Promise<PluginInfo[]>
Get user's currently installed plugins.
Returns
Promise<PluginInfo[]>
installPlugins
▸ installPlugins(plugins): Promise<void>
Open user dialog for user to optionally install plugins
Parameters
| Name | Type |
|---|---|
plugins | PluginInfo[] |
Returns
Promise<void>
isLoggedIn
▸ isLoggedIn(): Promise<boolean>
Returns true if thec user has been to logged in based in what is in authentication in the manifest
Returns
Promise<boolean>
isNetworkRequestCorsDisabled
▸ isNetworkRequestCorsDisabled(): Promise<boolean>
Used to determine whether requests from networkRequest are restricted by CORs.
Returns
Promise<boolean>
onCanParseUrl
▸ Optional onCanParseUrl(url, type): Promise<boolean>
Callback method that checks to see if url can be parsed by plugin so that onLookupPlaylistUrl returns results
Parameters
| Name | Type |
|---|---|
url | string |
type | ParseUrlType |
Returns
Promise<boolean>
onGetChannelVideos
▸ Optional onGetChannelVideos(request): Promise<ChannelVideosResult>
Callback method that gets a channel's videos. Used on /plugins/:pluginId/channels/:apiId
Parameters
| Name | Type |
|---|---|
request | ChannelVideosRequest |
Returns
Promise<ChannelVideosResult>
onGetCommentReplies
▸ Optional onGetCommentReplies(request): Promise<VideoCommentsResult>
Callback method to return replies to a VideoComment.
Parameters
| Name | Type |
|---|---|
request | CommentReplyRequest |
Returns
Promise<VideoCommentsResult>
onGetLiveVideo
▸ Optional onGetLiveVideo(requeset): Promise<undefined | Video>
Callback method to get live video information. Used on /plugins/:pluginId/channels/:apiId/live
Parameters
| Name | Type |
|---|---|
requeset | GetLiveVideoRequest |
Returns
Promise<undefined | Video>
onGetPlaylistVideos
▸ Optional onGetPlaylistVideos(request): Promise<PlaylistVideosResult>
Callback method that gets a playlist's videos. Used on /plugins/:pluginId/playlists/:apiId
Parameters
| Name | Type |
|---|---|
request | PlaylistVideoRequest |
Returns
Promise<PlaylistVideosResult>
onGetSearchSuggestions
▸ Optional onGetSearchSuggestions(request): Promise<string[]>
Callback method that takes a query and returns search suggestions
Parameters
| Name | Type |
|---|---|
request | GetSearchSuggestionsRequest |
Returns
Promise<string[]>
onGetTopItems
▸ Optional onGetTopItems(): Promise<SearchAllResult>
Callback method to return items to display on Home page.
Returns
Promise<SearchAllResult>
onGetUserChannels
▸ Optional onGetUserChannels(request): Promise<SearchChannelResult>
Callback method that gets a user's subscribed channels.
Parameters
| Name | Type |
|---|---|
request | UserChannelRequest |
Returns
Promise<SearchChannelResult>
onGetUserPlaylists
▸ Optional onGetUserPlaylists(request): Promise<SearchPlaylistResult>
Callback method that gets user playlists. Used on /plugins/:pluginId/playlists
Parameters
| Name | Type |
|---|---|
request | UserPlaylistRequest |
Returns
Promise<SearchPlaylistResult>
onGetVideo
▸ Optional onGetVideo(request): Promise<Video>
Callback method to get video information. Used on /plugins/:pluginId/videos/:apiId
Parameters
| Name | Type |
|---|---|
request | GetVideoRequest |
Returns
Promise<Video>
onGetVideoComments
▸ Optional onGetVideoComments(request): Promise<VideoCommentsResult>
Callback method to return video comments.
Parameters
| Name | Type |
|---|---|
request | VideoCommentsRequest |
Returns
Promise<VideoCommentsResult>
onLookupPlaylistUrl
▸ Optional onLookupPlaylistUrl(url): Promise<Playlist>
Callback method that takes a url and returns a playlist.
Used on the /playlists page.
Parameters
| Name | Type |
|---|---|
url | string |
Returns
Promise<Playlist>
onLookupVideoUrls
▸ Optional onLookupVideoUrls(urls): Promise<Video[]>
Callback method that takes urls and returns videos.
Parameters
| Name | Type |
|---|---|
urls | string[] |
Returns
Promise<Video[]>
onPostLogin
▸ Optional onPostLogin(): Promise<void>
Callback method that is called after the user has logged in
Returns
Promise<void>
onPostLogout
▸ Optional onPostLogout(): Promise<void>
Callback method that is called after the user has logged out
Returns
Promise<void>
onSearchAll
▸ Optional onSearchAll(request): Promise<SearchAllResult>
Callback method to return search results on /search
Remarks
This method must be set for the plugin to show on the
/search page
Parameters
| Name | Type |
|---|---|
request | SearchRequest |
Returns
Promise<SearchAllResult>
onSearchChannels
▸ Optional onSearchChannels(request): Promise<SearchChannelResult>
Callback method to return playlist search channels on /search
Remarks
This method must be set for channel pagination to work on the
/search page
Parameters
| Name | Type |
|---|---|
request | SearchRequest |
Returns
Promise<SearchChannelResult>
onSearchPlaylists
▸ Optional onSearchPlaylists(request): Promise<SearchPlaylistResult>
Callback method to return playlist search results on /search
Remarks
This method must be set for playlist pagination to work on the
/search page
Parameters
| Name | Type |
|---|---|
request | SearchRequest |
Returns
Promise<SearchPlaylistResult>
onSearchVideos
▸ Optional onSearchVideos(request): Promise<SearchVideoResult>
Callback method to return video search results on /search
Remarks
This method must be set for video pagination to work on the
/search page
Parameters
| Name | Type |
|---|---|
request | SearchRequest |
Returns
Promise<SearchVideoResult>
onUiMessage
▸ Optional onUiMessage(message): Promise<void>
Callback method that receives parent.postMessage requests from UI frames.
Parameters
| Name | Type |
|---|---|
message | any |
Returns
Promise<void>
onUsePlayer
▸ Optional onUsePlayer(): Promise<boolean>
Callback method to determine whether to use video player set in manifest.json. The player is used by default when it is set in manifest.json, but this method can disable it.
Returns
Promise<boolean>
postUiMessage
▸ postUiMessage(msg): Promise<void>
Sends a message to ui frames like options and player set in manifest.json.
Parameters
| Name | Type |
|---|---|
msg | any |
Returns
Promise<void>