com.ooyala.android.OoyalaAPIClient Class Reference

Public Member Functions

 OoyalaAPIClient (String apiKey, String secret, String pcode, PlayerDomain domain)
 Instantiate an OoyalaAPIClient. More...
 
 OoyalaAPIClient (String apiKey, String secret, String pcode, PlayerDomain domain, Options options)
 Instantiate an OoyalaAPIClient. More...
 
 OoyalaAPIClient (String apiKey, SignatureGenerator signatureGenerator, String pcode, PlayerDomain domain, Options options)
 Instantiate an OoyalaAPIClient. More...
 
 OoyalaAPIClient (SecureURLGenerator secureURLGenerator, String pcode, PlayerDomain domain, Options options)
 Instantiate an OoyalaAPIClient. More...
 
 OoyalaAPIClient (String pcode, PlayerDomain domain, Options options)
 Instantiate an OoyalaAPIClient. More...
 
 OoyalaAPIClient (String pcode, PlayerDomain domain, EmbedTokenGenerator generator, Options options)
 Instantiate an OoyalaAPIClient. More...
 
boolean authorize (AuthorizableItem item, PlayerInfo playerInfo) throws OoyalaException
 Perform a SAS Authorization on an authorizable item root item is assumed to be a Dynamic Channel and the embed codes are assumed to all be videos. More...
 
Video authorizeDownload (String embedCode, PlayerInfo playerInfo) throws OoyalaException
 Perform a SAS Authorization and creates an Video object. More...
 
ContentItem contentTree (List< String > embedCodes) throws OoyalaException
 Fetch the root ContentItem associated with the given embed codes. More...
 
ContentItem contentTreeWithAdSet (List< String > embedCodes, String adSetCode) throws OoyalaException
 Fetch the root ContentItem associated with the given embed codes and ad set code. More...
 
ContentItem contentTreeByExternalIds (List< String > externalIds) throws OoyalaException
 Fetch the root ContentItem associated with the given external ids. More...
 
PaginatedItemResponse contentTreeNext (PaginatedParentItem parent)
 Fetch additional children for the PaginatedParentItem specified using the nextToken specified. More...
 
JSONObject objectFromBacklotAPI (String uri, Map< String, String > params, int connectionTimeoutInMilliseconds, int readTimeoutInMilliseconds)
 Fetch a raw JSONObject from any backlot API (GET requests only). More...
 
void setRequireEmbedCodeMetadata (boolean requireEmbedCodeMetadata)
 Set if provider metadata associated with the embed codes is required. More...
 
Object objectFromBacklotAPI (String uri, Map< String, String > params, ObjectFromBacklotAPICallback callback, int connectionTimeoutInMilliseconds, int readTimeoutInMilliseconds)
 Asynchronously fetch a raw JSONObject from any backlot API (GET requests only) More...
 

Constructor & Destructor Documentation

com.ooyala.android.OoyalaAPIClient.OoyalaAPIClient ( String  apiKey,
String  secret,
String  pcode,
PlayerDomain  domain 
)

Instantiate an OoyalaAPIClient.

Parameters
apiKeythe API Key to use for secured APIs
secretthe Secret to use for secured APIs
pcodethe Provider Code
domainthe Embed Domain to use
com.ooyala.android.OoyalaAPIClient.OoyalaAPIClient ( String  apiKey,
String  secret,
String  pcode,
PlayerDomain  domain,
Options  options 
)

Instantiate an OoyalaAPIClient.

Parameters
apiKeythe API Key to use for secured APIs
secretthe Secret to use for secured APIs
pcodethe Provider Code
domainthe Embed Domain to use
optionsthe options to use
com.ooyala.android.OoyalaAPIClient.OoyalaAPIClient ( String  apiKey,
SignatureGenerator  signatureGenerator,
String  pcode,
PlayerDomain  domain,
Options  options 
)

Instantiate an OoyalaAPIClient.

Parameters
apiKeythe API Key to use for secured APIs
signatureGeneratorthe SignatureGenerator to use for secured APIs
pcodethe Provider Code
domainthe Embed Domain to use
com.ooyala.android.OoyalaAPIClient.OoyalaAPIClient ( SecureURLGenerator  secureURLGenerator,
String  pcode,
PlayerDomain  domain,
Options  options 
)

Instantiate an OoyalaAPIClient.

Parameters
secureURLGeneratorthe SecureURLGenerator to use for secured APIs
pcodethe Provider Code
domainthe Embed Domain to use
com.ooyala.android.OoyalaAPIClient.OoyalaAPIClient ( String  pcode,
PlayerDomain  domain,
Options  options 
)

Instantiate an OoyalaAPIClient.

Parameters
pcodethe Provider Code
domainthe Embed Domain to use
com.ooyala.android.OoyalaAPIClient.OoyalaAPIClient ( String  pcode,
PlayerDomain  domain,
EmbedTokenGenerator  generator,
Options  options 
)

Instantiate an OoyalaAPIClient.

Parameters
pcodethe Provider Code
domainthe Embed Domain to use

Member Function Documentation

boolean com.ooyala.android.OoyalaAPIClient.authorize ( AuthorizableItem  item,
PlayerInfo  playerInfo 
) throws OoyalaException

Perform a SAS Authorization on an authorizable item root item is assumed to be a Dynamic Channel and the embed codes are assumed to all be videos.

As this method is not asynchronous it should be used within an AsyncTask.

Parameters
itemthe content item to authorize
playerInfoa PlayerInfo object to determine what can be returned
Returns
success if authorization was successful (not if the item is authorized)
Exceptions
OoyalaException
Video com.ooyala.android.OoyalaAPIClient.authorizeDownload ( String  embedCode,
PlayerInfo  playerInfo 
) throws OoyalaException

Perform a SAS Authorization and creates an Video object.

Returns
the video object
Exceptions
OoyalaException
ContentItem com.ooyala.android.OoyalaAPIClient.contentTree ( List< String >  embedCodes) throws OoyalaException

Fetch the root ContentItem associated with the given embed codes.

If multiple embed codes are given, the root item is assumed to be a Dynamic Channel and the embed codes are assumed to all be videos. As this method is not asynchronous it should be used within an AsyncTask.

Parameters
embedCodesthe embed codes to fetch
Returns
the root ContentItem representing embedCodes
Exceptions
OoyalaException
ContentItem com.ooyala.android.OoyalaAPIClient.contentTreeByExternalIds ( List< String >  externalIds) throws OoyalaException

Fetch the root ContentItem associated with the given external ids.

If multiple external ids are given, the root item is assumed to be a Dynamic Channel and the external ids are assumed to all be videos. As this method is not asynchronous it should be used within an AsyncTask.

Parameters
externalIdsthe external ids to fetch
Returns
the root ContentItem representing externalIds
Exceptions
OoyalaException
PaginatedItemResponse com.ooyala.android.OoyalaAPIClient.contentTreeNext ( PaginatedParentItem  parent)

Fetch additional children for the PaginatedParentItem specified using the nextToken specified.

As this method is not asynchronous it should be used within an AsyncTask.

Parameters
parentthe PaginatedParentItem to fetch additional children for
Returns
the PaginatedItemResponse
ContentItem com.ooyala.android.OoyalaAPIClient.contentTreeWithAdSet ( List< String >  embedCodes,
String  adSetCode 
) throws OoyalaException

Fetch the root ContentItem associated with the given embed codes and ad set code.

If multiple embed codes are given, the root item is assumed to be a Dynamic Channel and the embed codes are assumed to all be videos. The ad set code specifies which ad set be used. As this method is not asynchronous it should be used within an AsyncTask.

Parameters
embedCodesthe embed codes to fetch
adSetCodethe ad set code to assign, can be null.
Returns
the root ContentItem representing embedCodes
Exceptions
OoyalaException
JSONObject com.ooyala.android.OoyalaAPIClient.objectFromBacklotAPI ( String  uri,
Map< String, String >  params,
int  connectionTimeoutInMilliseconds,
int  readTimeoutInMilliseconds 
)

Fetch a raw JSONObject from any backlot API (GET requests only).

As this method is not asynchronous it should be used within an AsyncTask.

Parameters
urithe URI to be fetched from backlot not including "/v2". For example, to request https://api.ooyala.com/v2/assets, uri should be "/assets"
paramsOptional parameters to pass to the API
connectionTimeoutInMillisecondsThe length of time to wait before timing out a network connection
readTimeoutInMillisecondsThe length of time to wait before timing out a network read
Returns
the raw JSONObject representing the response
Object com.ooyala.android.OoyalaAPIClient.objectFromBacklotAPI ( String  uri,
Map< String, String >  params,
ObjectFromBacklotAPICallback  callback,
int  connectionTimeoutInMilliseconds,
int  readTimeoutInMilliseconds 
)

Asynchronously fetch a raw JSONObject from any backlot API (GET requests only)

Parameters
urithe URI to be fetched from backlot not including "/v2". For example, to request https://api.ooyala.com/v2/assets, uri should be "/assets"
paramsOptional parameters to pass to the API
callbackthe ObjectFromBacklotAPICallback to execute when the response is received
connectionTimeoutInMillisecondsThe length of time to wait before timing out a network connection
readTimeoutInMillisecondsThe length of time to wait before timing out a network read
Returns
an Object that can be used to cancel the asynchronous fetch using the cancel(Object task) method
void com.ooyala.android.OoyalaAPIClient.setRequireEmbedCodeMetadata ( boolean  requireEmbedCodeMetadata)

Set if provider metadata associated with the embed codes is required.

Parameters
requireEmbedCodeMetadatashould be non-null and non-empty.