com.brightcove.proserve.mediaapi.wrapper
Class ReadApi

java.lang.Object
  extended by com.brightcove.proserve.mediaapi.wrapper.ReadApi

public class ReadApi
extends java.lang.Object

This is a wrapper for the HTTP/JSON Media API provided by Brightcove (http://www.brightcove.com)

While this library has been created by a member of Brightcove Professional Services, it IS NOT provided by Brightcove - no support, guarantees or warantees are provided. Brightcove may change the Media API at any point, rendering this library crippled or disabled until it is updated.

The purpose of this library is to provide a simple interface from Java applications to the Brightcove Media API. This class provides the interface to the READ portion of the Media API.

This library relies on the 3rd party JSON library from http://www.json.org/java/ which must be on the classpath.

For more information on the Media API, see http://support.brightcove.com/en/docs/getting-started-media-api.

Author:
Sander Gates

Constructor Summary
ReadApi()
          Default constructor
ReadApi(java.util.logging.Logger log)
          Constructor with logging
ReadApi(java.util.logging.Logger log, java.lang.String characterEncoding)
          Constructor with character set and logging
ReadApi(java.lang.String characterEncoding)
          Constructor with character set
 
Method Summary
 Playlists FindAllPlaylists(java.lang.String readToken, java.lang.Integer pageSize, java.lang.Integer pageNumber, SortByTypeEnum sortBy, SortOrderTypeEnum sortOrderType, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields, java.util.EnumSet<PlaylistFieldEnum> playlistFields)
          Looks in the specified account for all playlists
 Videos FindAllVideos(java.lang.String readToken, java.lang.Integer pageSize, java.lang.Integer pageNumber, SortByTypeEnum sortBy, SortOrderTypeEnum sortOrderType, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for all videos
 Videos FindModifiedVideos(java.lang.String readToken, java.lang.Long fromDate, java.util.Set<VideoStateFilterEnum> filter, java.lang.Integer pageSize, java.lang.Integer pageNumber, SortByTypeEnum sortBy, SortOrderTypeEnum sortOrderType, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Gets all the videos that have been modified since the given time
 Playlist FindPlaylistById(java.lang.String readToken, java.lang.Long playlistId, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields, java.util.EnumSet<PlaylistFieldEnum> playlistFields)
          Looks in the specified account for the specified playlist
 Playlist FindPlaylistByReferenceId(java.lang.String readToken, java.lang.String referenceId, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields, java.util.EnumSet<PlaylistFieldEnum> playlistFields)
          Looks in the specified account for the specified playlist
 Playlists FindPlaylistsByIds(java.lang.String readToken, java.util.Set<java.lang.Long> playlistIds, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields, java.util.EnumSet<PlaylistFieldEnum> playlistFields)
          Looks in the specified account for the specified playlists
 Playlists FindPlaylistsByReferenceIds(java.lang.String readToken, java.util.Set<java.lang.String> referenceIds, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields, java.util.EnumSet<PlaylistFieldEnum> playlistFields)
          Looks in the specified account for the specified playlists
 Playlists FindPlaylistsForPlayerId(java.lang.String readToken, java.lang.String playerId, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields, java.util.EnumSet<PlaylistFieldEnum> playlistFields)
          Looks in the specified account for the specified playlists
 Videos FindRelatedVideos(java.lang.String readToken, java.lang.Long videoId, java.lang.String referenceId, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for related videos.
 Video FindVideoById(java.lang.String readToken, java.lang.Long videoId, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for a video with the specified video id (not the reference id).
 Video FindVideoByReferenceId(java.lang.String readToken, java.lang.String referenceId, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for a video with the specified reference id (not the video id).
 Videos FindVideosByCampaignId(java.lang.String readToken, java.lang.String campaignId, java.lang.Integer pageSize, java.lang.Integer pageNumber, SortByTypeEnum sortBy, SortOrderTypeEnum sortOrderType, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Gets all the videos associated with the given campaign id.
 Videos FindVideosByIds(java.lang.String readToken, java.util.Set<java.lang.Long> videoIds, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for videos with the specified video ids (not the reference id).
 Videos FindVideosByReferenceIds(java.lang.String readToken, java.util.Set<java.lang.String> referenceIds, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for videos with the specified reference ids (not the video id).
 Videos FindVideosByTags(java.lang.String readToken, java.util.Set<java.lang.String> andTags, java.util.Set<java.lang.String> orTags, java.lang.Integer pageSize, java.lang.Integer pageNumber, SortByTypeEnum sortBy, SortOrderTypeEnum sortOrderType, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Performs a search on all the tags of the videos in this account, and returns a collection of videos that contain the specified tags.
 Videos FindVideosByText(java.lang.String readToken, java.lang.String text, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Searches through all the videos in this account, and returns a collection of videos whose name, short description, or long description contain a match for the specified text
 Videos FindVideosByUserId(java.lang.String readToken, java.lang.String userId, java.lang.Integer pageSize, java.lang.Integer pageNumber, SortByTypeEnum sortBy, SortOrderTypeEnum sortOrderType, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Retrieves the videos uploaded by the specified user id.
 java.lang.Boolean getEnableUds()
          For advanced users...
 void OverrideReadApiServerSettings(java.lang.String scheme, java.lang.String host, java.lang.Integer port, java.lang.String path)
          Overrides the standard Read API Server settings to make calls against a test/staging server.
 Videos SearchVideos(java.lang.String readToken, java.util.List<java.lang.String> all, java.util.List<java.lang.String> any, java.util.List<java.lang.String> none, java.lang.Boolean exact, SortByTypeEnum sortBy, SortOrderTypeEnum sortOrderType, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.EnumSet<VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Searches videos according to the criteria provided by the user.
 void setEnableUds(java.lang.Boolean enableUds)
          For advanced users...
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadApi

public ReadApi()

Default constructor

Creates a new Read API wrapper object with default settings


ReadApi

public ReadApi(java.util.logging.Logger log)

Constructor with logging

Creates a new Read API wrapper object with the following settings

Parameters:
log - java.util.logging.Logger object to log to

ReadApi

public ReadApi(java.lang.String characterEncoding)

Constructor with character set

Creates a new Read API wrapper object with the following settings

Parameters:
characterEncoding - Character encoding to use for HTTP URLs and responses

ReadApi

public ReadApi(java.util.logging.Logger log,
               java.lang.String characterEncoding)

Constructor with character set and logging

Creates a new Read API wrapper object with the following settings

Parameters:
log - java.util.logging.Logger object to log to
characterEncoding - Character encoding to use for HTTP URLs and responses
Method Detail

OverrideReadApiServerSettings

public void OverrideReadApiServerSettings(java.lang.String scheme,
                                          java.lang.String host,
                                          java.lang.Integer port,
                                          java.lang.String path)

Overrides the standard Read API Server settings to make calls against a test/staging server.

Parameters:
scheme - Protocol to use for call (usually http)
host - Host/IP address to call
port - Port to call on server
path - Path to API application on server

FindVideoById

public Video FindVideoById(java.lang.String readToken,
                           java.lang.Long videoId,
                           java.util.EnumSet<VideoFieldEnum> videoFields,
                           java.util.Set<java.lang.String> customFields)
                    throws BrightcoveException

Looks in the specified account for a video with the specified video id (not the reference id).

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
videoId - Brightcove id for the video to look for
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
Video object matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Video can not be found
  • Response from the Media API couldn't be parsed

FindAllVideos

public Videos FindAllVideos(java.lang.String readToken,
                            java.lang.Integer pageSize,
                            java.lang.Integer pageNumber,
                            SortByTypeEnum sortBy,
                            SortOrderTypeEnum sortOrderType,
                            java.util.EnumSet<VideoFieldEnum> videoFields,
                            java.util.Set<java.lang.String> customFields)
                     throws BrightcoveException

Looks in the specified account for all videos

Note that the Media API will only return at most 100 video per request. So to truly "find all videos", the caller must request "pages" of 1-100 videos at a time.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
pageSize - Number of videos per page (affects the number of videos returned by this call and the offset dictated by the pageNumber parameter)
pageNumber - Number of page to request (page size 100 and page number 1 returns videos 100-199)
sortBy - Sets the field to sort the videos on before cutting up the pages
sortOrderType - Sets the order to sort the videos in before cutting up the pages
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindRelatedVideos

public Videos FindRelatedVideos(java.lang.String readToken,
                                java.lang.Long videoId,
                                java.lang.String referenceId,
                                java.lang.Integer pageSize,
                                java.lang.Integer pageNumber,
                                java.util.EnumSet<VideoFieldEnum> videoFields,
                                java.util.Set<java.lang.String> customFields)
                         throws BrightcoveException

Looks in the specified account for related videos.

From http://docs.brightcove.com/en/media/:
Finds videos related to the given video. Combines the name and short description of the given video and searches for any partial matches in the name, description, and tags of all videos in the Brightcove media library for this account. More precise ways of finding related videos include tagging your videos by subject and using the find_videos_by_tags method to find videos that share the same tags: or creating a playlist that includes videos that you know are related.

Parameters:
readToken - The authentication token provided to authorize using the Media APIs. A string, generally ending in . (dot).
videoId - The id of the video we'd like related videos for. Optional (pass null to omit)
referenceId - The publisher-assigned reference id of the video we'd like related videos for. Optional (pass null to omit)
pageSize - Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100. Optional (pass null to omit)
pageNumber - The zero-indexed number of the page to return. Optional (pass null to omit)
videoFields - Set of video fields to populate on the returned Video object.
customFields - Set of custom fields to populate on the returned Video object.
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindVideosByIds

public Videos FindVideosByIds(java.lang.String readToken,
                              java.util.Set<java.lang.Long> videoIds,
                              java.util.EnumSet<VideoFieldEnum> videoFields,
                              java.util.Set<java.lang.String> customFields)
                       throws BrightcoveException

Looks in the specified account for videos with the specified video ids (not the reference id).

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
videoIds - Brightcove ids for the videos to look for
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Response from the Media API couldn't be parsed

FindVideoByReferenceId

public Video FindVideoByReferenceId(java.lang.String readToken,
                                    java.lang.String referenceId,
                                    java.util.EnumSet<VideoFieldEnum> videoFields,
                                    java.util.Set<java.lang.String> customFields)
                             throws BrightcoveException

Looks in the specified account for a video with the specified reference id (not the video id).

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
referenceId - Custom reference id for the video to look for
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
Video object matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Video can not be found
  • Response from the Media API couldn't be parsed

FindVideosByReferenceIds

public Videos FindVideosByReferenceIds(java.lang.String readToken,
                                       java.util.Set<java.lang.String> referenceIds,
                                       java.util.EnumSet<VideoFieldEnum> videoFields,
                                       java.util.Set<java.lang.String> customFields)
                                throws BrightcoveException

Looks in the specified account for videos with the specified reference ids (not the video id).

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
referenceIds - Reference ids for the videos to look for
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • One or more Reference Ids contains a comma
  • Response from the Media API couldn't be parsed

FindVideosByUserId

public Videos FindVideosByUserId(java.lang.String readToken,
                                 java.lang.String userId,
                                 java.lang.Integer pageSize,
                                 java.lang.Integer pageNumber,
                                 SortByTypeEnum sortBy,
                                 SortOrderTypeEnum sortOrderType,
                                 java.util.EnumSet<VideoFieldEnum> videoFields,
                                 java.util.Set<java.lang.String> customFields)
                          throws BrightcoveException

Retrieves the videos uploaded by the specified user id. This method can be used to find videos submitted using the consumer- generated media (CGM) module.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
userId - The id of the user whose videos we'd like to retrieve
pageSize - Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100. Optional (pass null to omit)
pageNumber - The zero-indexed number of the page to return. Optional (pass null to omit)
sortBy - Sets the field to sort the videos on before cutting up the pages
sortOrderType - Sets the order to sort the videos in before cutting up the pages
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindVideosByCampaignId

public Videos FindVideosByCampaignId(java.lang.String readToken,
                                     java.lang.String campaignId,
                                     java.lang.Integer pageSize,
                                     java.lang.Integer pageNumber,
                                     SortByTypeEnum sortBy,
                                     SortOrderTypeEnum sortOrderType,
                                     java.util.EnumSet<VideoFieldEnum> videoFields,
                                     java.util.Set<java.lang.String> customFields)
                              throws BrightcoveException

Gets all the videos associated with the given campaign id. Campaigns are a feature of the consumer-generated media (CGM) module

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
campaignId - The id of the campaign you'd like to fetch videos for
pageSize - Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100. Optional (pass null to omit)
pageNumber - The zero-indexed number of the page to return. Optional (pass null to omit)
sortBy - Sets the field to sort the videos on before cutting up the pages
sortOrderType - Sets the order to sort the videos in before cutting up the pages
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindModifiedVideos

public Videos FindModifiedVideos(java.lang.String readToken,
                                 java.lang.Long fromDate,
                                 java.util.Set<VideoStateFilterEnum> filter,
                                 java.lang.Integer pageSize,
                                 java.lang.Integer pageNumber,
                                 SortByTypeEnum sortBy,
                                 SortOrderTypeEnum sortOrderType,
                                 java.util.EnumSet<VideoFieldEnum> videoFields,
                                 java.util.Set<java.lang.String> customFields)
                          throws BrightcoveException

Gets all the videos that have been modified since the given time

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
fromDate - The date, specified in minutes since January 1st, 1970 00:00:00 GMT, of the oldest Video which you would like returned
filter - Filters the set of videos to return
pageSize - Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100. Optional (pass null to omit)
pageNumber - The zero-indexed number of the page to return. Optional (pass null to omit)
sortBy - Sets the field to sort the videos on before cutting up the pages
sortOrderType - Sets the order to sort the videos in before cutting up the pages
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

SearchVideos

public Videos SearchVideos(java.lang.String readToken,
                           java.util.List<java.lang.String> all,
                           java.util.List<java.lang.String> any,
                           java.util.List<java.lang.String> none,
                           java.lang.Boolean exact,
                           SortByTypeEnum sortBy,
                           SortOrderTypeEnum sortOrderType,
                           java.lang.Integer pageSize,
                           java.lang.Integer pageNumber,
                           java.util.EnumSet<VideoFieldEnum> videoFields,
                           java.util.Set<java.lang.String> customFields)
                    throws BrightcoveException

Searches videos according to the criteria provided by the user. The criteria are constructed using field/value pairs specified in the command.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
all - (optional) Specifies the field:value pairs for search criteria that MUST be present in the index in order to return a hit in the result set. The format is fieldName:value. If the field's name is not present, it is assumed to be name and shortDescription.
any - (optional) Specifies the field:value pairs for search criteria AT LEAST ONE of which must be present to return a hit in the result set. The format is fieldName:value. If the field's name is not present, it is assumed to be name and shortDescription.
none - (optional) Specifies the field:value pairs for search criteria that MUST NOT be present to return a hit in the result set. The format is fieldName:value. If the field's name is not present, it is assumed to be name and shortDescription.
exact - (optional) Boolean If true, disables fuzzy search and requires an exact match of search terms. A fuzzy search does not require an exact match of the indexed terms, but will return a hit for terms that are closely related based on language-specific criteria. The fuzzy search is available only if your account is based in the United States.
sortByCriteria - (optional) Specifies the field to sort by, and the direction to sort in. This is specified as: sortFieldName:direction If the direction is not provided, it is assumed to be in ascending order Specify the direction as "asc" for ascending or "desc" for descending. You can sort by the following fields: PUBLISH_DATE, CREATION_DATE, MODIFIED_DATE, PLAYS_TRAILING_WEEK, PLAYS_TOTAL.
page_size - (optional) Integer Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100.
page_number - (optional) Integer The zero-indexed number of the page to return.
get_item_count - (optional) Boolean If true, also return how many total results there are.
video_fields - (optional) EnumSet A comma-separated list of the fields you wish to have populated in the Videos contained in the returned object. If you omit this parameter, the method returns the following fields of the video: id, name, shortDescription, longDescription, creationDate, publisheddate, lastModifiedDate, linkURL, linkText, tags, videoStillURL, thumbnailURL, referenceId, length, economics, playsTotal, playsTrailingWeek. If you use a token with URL access, this method also returns FLVURL, renditions, FLVFullLength, videoFullLength.
custom_fields - (optional) Set A comma-separated list of the custom fields you wish to have populated in the videos contained in the returned object. If you omit this parameter, no custom fields are returned, unless you include the value 'customFields' in the video_fields parameter.
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindVideosByText

public Videos FindVideosByText(java.lang.String readToken,
                               java.lang.String text,
                               java.lang.Integer pageSize,
                               java.lang.Integer pageNumber,
                               java.util.EnumSet<VideoFieldEnum> videoFields,
                               java.util.Set<java.lang.String> customFields)
                        throws BrightcoveException

Searches through all the videos in this account, and returns a collection of videos whose name, short description, or long description contain a match for the specified text

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
text - The text we're searching for
pageSize - Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100. Optional (pass null to omit)
pageNumber - The zero-indexed number of the page to return. Optional (pass null to omit)
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindVideosByTags

public Videos FindVideosByTags(java.lang.String readToken,
                               java.util.Set<java.lang.String> andTags,
                               java.util.Set<java.lang.String> orTags,
                               java.lang.Integer pageSize,
                               java.lang.Integer pageNumber,
                               SortByTypeEnum sortBy,
                               SortOrderTypeEnum sortOrderType,
                               java.util.EnumSet<VideoFieldEnum> videoFields,
                               java.util.Set<java.lang.String> customFields)
                        throws BrightcoveException

Performs a search on all the tags of the videos in this account, and returns a collection of videos that contain the specified tags. Note that tags are not case-sensitive

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
andTags - Limit the results to those that contain all of these tags
orTags - Limit the results to those that contain at least one of these tags
pageSize - Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100. Optional (pass null to omit)
pageNumber - The zero-indexed number of the page to return. Optional (pass null to omit)
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindAllPlaylists

public Playlists FindAllPlaylists(java.lang.String readToken,
                                  java.lang.Integer pageSize,
                                  java.lang.Integer pageNumber,
                                  SortByTypeEnum sortBy,
                                  SortOrderTypeEnum sortOrderType,
                                  java.util.EnumSet<VideoFieldEnum> videoFields,
                                  java.util.Set<java.lang.String> customFields,
                                  java.util.EnumSet<PlaylistFieldEnum> playlistFields)
                           throws BrightcoveException

Looks in the specified account for all playlists

Note that the Media API will only return at most 100 playlists per request. So to truly "find all videos", the caller must request "pages" of 1-100 playlists at a time.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
pageSize - Number of playlists per page (affects the number of playlists returned by this call and the offset dictated by the pageNumber parameter)
pageNumber - Number of page to request (page size 100 and page number 1 returns playlists 100-199)
sortBy - Sets the field to sort the playlists on before cutting up the pages
sortOrderType - Sets the order to sort the playlists in before cutting up the pages
videoFields - Set of video fields to populate on the returned Video objects
customFields - Set of custom fields to populate on the returned Video objects
playlistFields - A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields.
Returns:
List of Playlist objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many playlists per page
  • Response from the Media API couldn't be parsed

FindPlaylistById

public Playlist FindPlaylistById(java.lang.String readToken,
                                 java.lang.Long playlistId,
                                 java.util.EnumSet<VideoFieldEnum> videoFields,
                                 java.util.Set<java.lang.String> customFields,
                                 java.util.EnumSet<PlaylistFieldEnum> playlistFields)
                          throws BrightcoveException

Looks in the specified account for the specified playlist

Finds a particular playlist based on its id.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
playlistId - The id of the playlist requested.
videoFields - Set of video fields to populate on the returned Video objects
customFields - Set of custom fields to populate on the returned Video objects
playlistFields - A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields.
Returns:
Playlist requested
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Playlist requested does not exist
  • Response from the Media API couldn't be parsed

FindPlaylistByReferenceId

public Playlist FindPlaylistByReferenceId(java.lang.String readToken,
                                          java.lang.String referenceId,
                                          java.util.EnumSet<VideoFieldEnum> videoFields,
                                          java.util.Set<java.lang.String> customFields,
                                          java.util.EnumSet<PlaylistFieldEnum> playlistFields)
                                   throws BrightcoveException

Looks in the specified account for the specified playlist

Finds a particular playlist based on its reference id.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
referenceId - The reference id of the playlist requested.
videoFields - Set of video fields to populate on the returned Video objects
customFields - Set of custom fields to populate on the returned Video objects
playlistFields - A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields.
Returns:
Playlist requested
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Playlist requested does not exist
  • Response from the Media API couldn't be parsed

FindPlaylistsByIds

public Playlists FindPlaylistsByIds(java.lang.String readToken,
                                    java.util.Set<java.lang.Long> playlistIds,
                                    java.util.EnumSet<VideoFieldEnum> videoFields,
                                    java.util.Set<java.lang.String> customFields,
                                    java.util.EnumSet<PlaylistFieldEnum> playlistFields)
                             throws BrightcoveException

Looks in the specified account for the specified playlists

Finds particular playlists based on ids.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
playlistIds - The ids of the playlists requested.
videoFields - Set of video fields to populate on the returned Video objects
customFields - Set of custom fields to populate on the returned Video objects
playlistFields - A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields.
Returns:
List of Playlist objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many playlists per page
  • Response from the Media API couldn't be parsed

FindPlaylistsByReferenceIds

public Playlists FindPlaylistsByReferenceIds(java.lang.String readToken,
                                             java.util.Set<java.lang.String> referenceIds,
                                             java.util.EnumSet<VideoFieldEnum> videoFields,
                                             java.util.Set<java.lang.String> customFields,
                                             java.util.EnumSet<PlaylistFieldEnum> playlistFields)
                                      throws BrightcoveException

Looks in the specified account for the specified playlists

Finds particular playlists based on reference ids.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
referenceIds - The reference ids of the playlists requested.
videoFields - Set of video fields to populate on the returned Video objects
customFields - Set of custom fields to populate on the returned Video objects
playlistFields - A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields.
Returns:
List of Playlist objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Response from the Media API couldn't be parsed

FindPlaylistsForPlayerId

public Playlists FindPlaylistsForPlayerId(java.lang.String readToken,
                                          java.lang.String playerId,
                                          java.lang.Integer pageSize,
                                          java.lang.Integer pageNumber,
                                          java.util.EnumSet<VideoFieldEnum> videoFields,
                                          java.util.Set<java.lang.String> customFields,
                                          java.util.EnumSet<PlaylistFieldEnum> playlistFields)
                                   throws BrightcoveException

Looks in the specified account for the specified playlists

Finds particular playlists based on player id.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
playerId - The player id whose playlists we want to return.
pageSize - Number of playlists per page (affects the number of playlists returned by this call and the offset dictated by the pageNumber parameter)
pageNumber - Number of page to request (page size 100 and page number 1 returns playlists 100-199)
videoFields - Set of video fields to populate on the returned Video objects
customFields - Set of custom fields to populate on the returned Video objects
playlistFields - A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields.
Returns:
List of Playlist objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many playlists per page
  • Response from the Media API couldn't be parsed

setEnableUds

public void setEnableUds(java.lang.Boolean enableUds)

For advanced users...

If true, forces the returned URLs in Renditions to be Progressive Download instead of streaming. Note that in order for this to work, your account must be enabled for Universal Delivery - something that can only be done by Brightcove Support.


getEnableUds

public java.lang.Boolean getEnableUds()

For advanced users...

If true, forces the returned URLs in Renditions to be Progressive Download instead of streaming. Note that in order for this to work, your account must be enabled for Universal Delivery - something that can only be done by Brightcove Support.

Returns:
Whether or not UDS URLs should be returned by the Media API