public class VideosResource extends AbstractResource
VideosResource provides the functionality
to access the /videos endpoints of the Twitch API.AbstractResource.TwitchHttpResponseHandlerhttp, objectMapper| Constructor and Description |
|---|
VideosResource(java.lang.String baseUrl,
int apiVersion)
Construct the resource using the Twitch API base URL and specified API version.
|
| Modifier and Type | Method and Description |
|---|---|
void |
get(java.lang.String id,
VideoResponseHandler handler)
Returns a
Video object. |
void |
getFollowed(com.mb3364.http.RequestParams params,
VideosResponseHandler handler)
Returns a list of
Video's from channels that the authenticated user is following. |
void |
getFollowed(VideosResponseHandler handler)
Returns a list of
Video's from channels that the authenticated user is following. |
void |
getTop(com.mb3364.http.RequestParams params,
VideosResponseHandler handler)
Returns a list of
Video's created in a given time period sorted by number of views, most popular first. |
void |
getTop(VideosResponseHandler handler)
Returns a list of
Video's created in a given time period sorted by number of views, most popular first. |
getBaseUrl, setAuthAccessToken, setClientIdpublic VideosResource(java.lang.String baseUrl,
int apiVersion)
baseUrl - the base URL of the Twitch APIapiVersion - the requested version of the Twitch APIpublic void get(java.lang.String id,
VideoResponseHandler handler)
Video object.id - the ID of the Videohandler - the response handlerpublic void getTop(com.mb3364.http.RequestParams params,
VideosResponseHandler handler)
Video's created in a given time period sorted by number of views, most popular first.params - the optional request parameters:
limit: the maximum number of objects in array. Maximum is 100.offset: the object offset for pagination. Default is 0.game: Returns only videos from game.period: Returns only videos created in time period.
Valid values are week, month,
or all. Default is week.
handler - the response handlerpublic void getTop(VideosResponseHandler handler)
Video's created in a given time period sorted by number of views, most popular first.handler - the response handlerpublic void getFollowed(com.mb3364.http.RequestParams params,
VideosResponseHandler handler)
Video's from channels that the authenticated user is following.
Authenticated, required scope: Scopes.USER_READparams - the optional request parameters:
limit: the maximum number of objects in array. Maximum is 100.offset: the object offset for pagination. Default is 0.handler - the response handlerpublic void getFollowed(VideosResponseHandler handler)
Video's from channels that the authenticated user is following.
Authenticated, required scope: Scopes.USER_READhandler - the response handler