Skip to main content

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
NameType
inputRequestInfo | URL
init?RequestInit
Returns

Promise<Response>

Methods

addPlaylists

addPlaylists(playlists): Promise<void>

Adds or updates playlists. Playlists with the same id are updated.

Parameters

NameType
playlistsPlaylist[]

Returns

Promise<void>


addVideosToPlaylist

addVideosToPlaylist(playlistId, videos): Promise<void>

Adds videos to a playlist

Parameters

NameTypeDescription
playlistIdstringid of playlist
videosVideo[]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

NameType
notificationNotificationMessage

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

NameType
pluginsPluginInfo[]

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

NameType
urlstring
typeParseUrlType

Returns

Promise<boolean>


onGetChannelVideos

Optional onGetChannelVideos(request): Promise<ChannelVideosResult>

Callback method that gets a channel's videos. Used on /plugins/:pluginId/channels/:apiId

Parameters

NameType
requestChannelVideosRequest

Returns

Promise<ChannelVideosResult>


onGetCommentReplies

Optional onGetCommentReplies(request): Promise<VideoCommentsResult>

Callback method to return replies to a VideoComment.

Parameters

NameType
requestCommentReplyRequest

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

NameType
requesetGetLiveVideoRequest

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

NameType
requestPlaylistVideoRequest

Returns

Promise<PlaylistVideosResult>


onGetSearchSuggestions

Optional onGetSearchSuggestions(request): Promise<string[]>

Callback method that takes a query and returns search suggestions

Parameters

NameType
requestGetSearchSuggestionsRequest

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

NameType
requestUserChannelRequest

Returns

Promise<SearchChannelResult>


onGetUserPlaylists

Optional onGetUserPlaylists(request): Promise<SearchPlaylistResult>

Callback method that gets user playlists. Used on /plugins/:pluginId/playlists

Parameters

NameType
requestUserPlaylistRequest

Returns

Promise<SearchPlaylistResult>


onGetVideo

Optional onGetVideo(request): Promise<Video>

Callback method to get video information. Used on /plugins/:pluginId/videos/:apiId

Parameters

NameType
requestGetVideoRequest

Returns

Promise<Video>


onGetVideoComments

Optional onGetVideoComments(request): Promise<VideoCommentsResult>

Callback method to return video comments.

Parameters

NameType
requestVideoCommentsRequest

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

NameType
urlstring

Returns

Promise<Playlist>


onLookupVideoUrls

Optional onLookupVideoUrls(urls): Promise<Video[]>

Callback method that takes urls and returns videos.

Parameters

NameType
urlsstring[]

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

NameType
requestSearchRequest

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

NameType
requestSearchRequest

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

NameType
requestSearchRequest

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

NameType
requestSearchRequest

Returns

Promise<SearchVideoResult>


onUiMessage

Optional onUiMessage(message): Promise<void>

Callback method that receives parent.postMessage requests from UI frames.

Parameters

NameType
messageany

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

NameType
msgany

Returns

Promise<void>