|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brightcove.proserve.mediaapi.wrapper.WriteApi
public class WriteApi
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 WRITE 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.
Constructor Summary | |
---|---|
WriteApi()
Default constructor |
|
WriteApi(java.util.logging.Logger log)
Constructor with logging |
|
WriteApi(java.util.logging.Logger log,
java.lang.String characterEncoding)
Constructor with character set and logging |
|
WriteApi(java.lang.String characterEncoding)
Constructor with character set |
Method Summary | |
---|---|
Image |
AddImage(java.lang.String writeToken,
Image image,
java.lang.String filename,
java.lang.Long videoId,
java.lang.String videoReferenceId,
java.lang.Boolean resize)
Add a new thumbnail or video still image to a video, or assign an existing image to another video. |
java.lang.Long |
CreatePlaylist(java.lang.String writeToken,
Playlist playlist)
Creates a playlist. |
java.lang.Long |
CreateVideo(java.lang.String writeToken,
Video video,
java.lang.String filename,
TranscodeEncodeToEnum encodeTo,
java.lang.Boolean createMultipleRenditions,
java.lang.Boolean preserveSourceRendition,
java.lang.Boolean h264NoProcessing)
Create a new video in the account. |
JSONObject |
DeletePlaylist(java.lang.String writeToken,
java.lang.Long playlistId,
java.lang.String referenceId,
java.lang.Boolean cascade)
Deletes a playlist, specified by playlist id. |
JSONObject |
DeleteVideo(java.lang.String writeToken,
java.lang.Long videoId,
java.lang.String referenceId,
java.lang.Boolean cascade,
java.lang.Boolean deleteShares)
Deletes a video. |
UploadStatusEnum |
GetUploadStatus(java.lang.String writeToken,
java.lang.Long videoId,
java.lang.String referenceId)
Call this function in an HTTP POST request to determine the status of an upload. |
java.util.List<java.lang.Long> |
ShareVideo(java.lang.String writeToken,
java.lang.Long videoId,
java.lang.Boolean autoAccept,
java.util.List<java.lang.Long> shareeAccountIds)
Shares the specified video with a list of sharee accounts |
java.util.List<java.lang.Long> |
ShareVideo(java.lang.String writeToken,
java.lang.Long videoId,
java.lang.Boolean autoAccept,
java.util.List<java.lang.Long> shareeAccountIds,
java.lang.Boolean forceReshare)
Shares the specified video with a list of sharee accounts |
Playlist |
UpdatePlaylist(java.lang.String writeToken,
Playlist playlist)
Updates a playlist, specified by playlist id. |
Video |
UpdateVideo(java.lang.String writeToken,
Video video)
Use this method to modify the metadata for a single video in your Brightcove Media Library. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WriteApi()
Default constructor
Creates a new Read API wrapper object with default settings
public WriteApi(java.util.logging.Logger log)
Constructor with logging
Creates a new Read API wrapper object with the following settings
log
- java.util.logging.Logger object to log topublic WriteApi(java.lang.String characterEncoding)
Constructor with character set
Creates a new Read API wrapper object with the following settings
characterEncoding
- Character encoding to use for HTTP URLs and responsespublic WriteApi(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
log
- java.util.logging.Logger object to log tocharacterEncoding
- Character encoding to use for HTTP URLs and responsesMethod Detail |
---|
public java.lang.Long CreateVideo(java.lang.String writeToken, Video video, java.lang.String filename, TranscodeEncodeToEnum encodeTo, java.lang.Boolean createMultipleRenditions, java.lang.Boolean preserveSourceRendition, java.lang.Boolean h264NoProcessing) throws BrightcoveException
Create a new video in the account.
writeToken
- Write Media API token for the account.video
- Video object with all of the meta data to createfilename
- Name of file to use for the video renditionencodeTo
- If the file requires transcoding, use this parameter to specify the target encoding. Valid values are MP4 or FLV, representing the H264 and VP6 codecs respectively. Note that transcoding of FLV files to another codec is not currently supported.createMultipleRenditions
- If the file is a supported transcodeable type, this optional flag can be used to control the number of transcoded renditions. If true (default), multiple renditions at varying encoding rates and dimensions are created. Setting this to false will cause a single transcoded VP6 rendition to be created at the standard encoding rate and dimensions.preserveSourceRendition
- If the video file is H.264 encoded and if create_multiple_ renditions=true, then multiple VP6 renditions are created and in addition the H.264 source is retained as an additional rendition.h264NoProcessing
- Use this option to prevent H.264 source files from being transcoded. This parameter cannot be used in combination with create_multiple_renditions. It is optional and defaults to false.
BrightcoveException
- If any of the following are true:public Image AddImage(java.lang.String writeToken, Image image, java.lang.String filename, java.lang.Long videoId, java.lang.String videoReferenceId, java.lang.Boolean resize) throws BrightcoveException
Add a new thumbnail or video still image to a video, or assign an existing image to another video.
writeToken
- Write Media API token for the account.image
- Image object with all of the meta data to createfilename
- Name of file to use for the imagevideoId
- The id of the video to associate this image withvideoReferenceId
- The reference id of the video to associate this image withresize
- Set this to false if you don't want your image to be automatically resized to the default size for its type. By default images will be resized.
BrightcoveException
- If any of the following are true:public UploadStatusEnum GetUploadStatus(java.lang.String writeToken, java.lang.Long videoId, java.lang.String referenceId) throws BrightcoveException
Call this function in an HTTP POST request to determine the status of an upload.
writeToken
- The Write API authentication token required to use this method.videoId
- The id of the video whose status you'd like to get.referenceId
- The publisher-assigned reference id of the video whose status you'd like to get.
BrightcoveException
- If any of the following are true:public JSONObject DeleteVideo(java.lang.String writeToken, java.lang.Long videoId, java.lang.String referenceId, java.lang.Boolean cascade, java.lang.Boolean deleteShares) throws BrightcoveException
Deletes a video.
writeToken
- The Write API authentication token required to use this method. A string, generally ending in . (dot).videoId
- The id of the video you'd like to deletereferenceId
- The publisher-assigned reference id of the video you'd like to delete.cascade
- Set this to true if you want to delete this video even if it is part of a manual playlist or assigned to a player. The video will be removed from all playlists and players in which it appears, then deleted.deleteShares
- Set this to true if you want also to delete shared copies of this video. Note that this will delete all shared copies from sharee accounts, regardless of whether or not those accounts are currently using the video in playlists or players.
BrightcoveException
- If any of the following are true:public java.util.List<java.lang.Long> ShareVideo(java.lang.String writeToken, java.lang.Long videoId, java.lang.Boolean autoAccept, java.util.List<java.lang.Long> shareeAccountIds) throws BrightcoveException
Shares the specified video with a list of sharee accounts
writeToken
- The Write API authentication token required to use this method.videoId
- The id for video that will be shared.autoAccept
- If the target account has the option enabled, setting this flag to true will bypass the approval process, causing the shared video to automatically appear in the target account's library. If the target account does not have the option enabled, or this flag is unspecified or false, then the shared video will be queued up to be approved by the target account before appearing in their library.shareeAccountIds
- List of Account IDs to share video with.
BrightcoveException
- If any of the following are true:public java.util.List<java.lang.Long> ShareVideo(java.lang.String writeToken, java.lang.Long videoId, java.lang.Boolean autoAccept, java.util.List<java.lang.Long> shareeAccountIds, java.lang.Boolean forceReshare) throws BrightcoveException
Shares the specified video with a list of sharee accounts
writeToken
- The Write API authentication token required to use this method.videoId
- The id for video that will be shared.autoAccept
- If the target account has the option enabled, setting this flag to true will bypass the approval process, causing the shared video to automatically appear in the target account's library. If the target account does not have the option enabled, or this flag is unspecified or false, then the shared video will be queued up to be approved by the target account before appearing in their library.shareeAccountIds
- List of Account IDs to share video with.forceReshare
- Setting force_reshare to true indicates that if the shared video already exists in the target account's library, it should be overwritten by the video in the sharer's account
BrightcoveException
- If any of the following are true:public Video UpdateVideo(java.lang.String writeToken, Video video) throws BrightcoveException
Use this method to modify the metadata for a single video in your Brightcove Media Library.
writeToken
- The Write API authentication token required to use this method.video
- The video meta data to be updated.
BrightcoveException
- If any of the following are true:public java.lang.Long CreatePlaylist(java.lang.String writeToken, Playlist playlist) throws BrightcoveException
Creates a playlist. This method must be called using an HTTP POST request and JSON parameters.
writeToken
- The authentication token provided to authorize using the Media APIs. A string, generally ending in . (dot).playlist
- The metadata for the playlist you'd like to create. This takes the form of a JSON object of name/value pairs, each of which corresponds to a settable property of the Playlist object. Populate the videoIds property of the playlist, not the videos property.
BrightcoveException
- If any of the following are true:public Playlist UpdatePlaylist(java.lang.String writeToken, Playlist playlist) throws BrightcoveException
Updates a playlist, specified by playlist id. This method must be called using an HTTP POST request and JSON parameters.
writeToken
- The authentication token provided to authorize using the Media APIs. A string, generally ending in . (dot).playlist
- The metadata for the playlist you'd like to create. This takes the form of a JSON object of name/value pairs, each of which corresponds to a settable property of the Playlist object. Populate the videoIds property of the playlist, not the videos property.
BrightcoveException
- If any of the following are true:public JSONObject DeletePlaylist(java.lang.String writeToken, java.lang.Long playlistId, java.lang.String referenceId, java.lang.Boolean cascade) throws BrightcoveException
Deletes a playlist, specified by playlist id.
writeToken
- The authentication token provided to authorize using the Media APIs. A string, generally ending in . (dot).playlistId
- the id for the playlist to deletereferenceId
- The publisher-assigned reference id of the playlist you'd like to delete.cascade
- Set this to true if you'd like to delete this playlist even if it is referenced by players. The playlist will be removed from all players in which it appears, then deleted.
BrightcoveException
- If any of the following are true:
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |