com.brightcove.proserve.mediaapi.wrapper.apiobjects
Class Video

java.lang.Object
  extended by com.brightcove.proserve.mediaapi.wrapper.apiobjects.Video

public class Video
extends java.lang.Object

Represents a Video object to/from the Media API.

From the Brightcove documentation on 2009/08/18 (http://support.brightcove.com/en/docs/media-api-objects-reference):
The Video object is an aggregation of metadata and asset information associated with a video. A Video has the following properties:

property name type read only? description
name String no The title of this Video, limited to 60 characters. The name is a required property when you create a video.
id long yes A number that uniquely identifies this Video, assigned by Brightcove when the Video is created.
referenceId String no A user-specified id that uniquely identifies this Video, limited to 150 characters. A referenceID can be used as a foreign-key to identify this video in another system.
accountId long yes A number, assigned by Brightcove, that uniquely identifies the account to which this Video belongs.
shortDescription String no A short description describing this Video, limited to 250 characters. The shortDescription is a required property when you create a video.
longDescription String no A longer description of this Video, limited to 5000 characters.
FLVURL String yes The URL of the video file for this Video. Note that this property can be accessed with the Media API only with a special read or write token. See Accessing Video Content with the Media API.
renditions Array no An array of Renditions that represent the dynamic delivery renditions available for this Video. A Video should have not more than 10 Renditions. Note that this property can be accessed with the Media API only with a special read or write token. See Accessing Video Content with the Media API.
videoFullLength Rendition no A single Rendition that represents the the video file for this Video. Note that this property can be accessed with the Media API only with a special read or write token. See Accessing Video Content with the Media API.
creationDate Date yes The date this Video was created, represented as the number of milliseconds since the UNIX epoch.
publishedDate Date yes The date this Video was last made active, represented as the number of milliseconds since the Unix epoch.
lastModifiedDate Date yes The date this Video was last modified, represented as the number of milliseconds since the Unix epoch.
itemState Enum no An ItemStateEnum. One of ACTIVE, INACTIVE, or DELETED. You can set this property only to ACTIVE or INACTIVE; you cannot delete a video by setting its itemState to DELETED.
startDate Date no The first date this Video is available to be played, represented as the number of milliseconds since the Unix epoch.
endDate Date no The last date this Video is available to be played, represented as the number of milliseconds since the Unix epoch.
linkURL String no An optional URL to a related item, limited to 150 characters.
linkText String no The text displayed for the linkURL, limited to 40 characters.
tags List no A list of Strings representing the tags assigned to this Video. Each tag can be not more than 64 characters, and a video can have no more than 1200 tags.
videoStillURL String yes The URL to the video still image associated with this Video. Video stills are 480x360 pixels.
thumbnailURL String yes The URL to the thumbnail image associated with this Video. Thumbnails are 120x90 pixels.
length long yes The length of this video in milliseconds.
economics Enum no An EconomicsEnum. Either FREE or AD_SUPPORTED. AD_SUPPORTED means that ad requests are enabled for this Video.
geoFiltered boolean no True indicates that the video is geo-restricted.
geoFilteredCountries List no A list of the ISO-3166 two-letter codes of the countries to enforce geo-restriction rules on. Use lowercase for the country codes.
geoFilterExclude boolean no If true, the video can be viewed in all countries except those listed in geoFilteredCountries; if false, the video can be viewed only in the countries listed in geoFilteredCountries.
cuePoints List no A List of the CuePoints objects assigned to this Video.
playsTotal Integer yes How many times this Video has been played since its creation.
playsTrailingWeek Integer yes How many times this Video has been played within the past seven days, exclusive of today.

Note that another field - "Custom Fields" is also supported by this API, but not officially documented as yet.

Author:
Sander Gates

Constructor Summary
Video()
          Default Constructor.
Video(JSONObject jsonObj)
          Constructor using JSON object.
Video(java.lang.String json)
          Constructor using JSON string.
 
Method Summary
 java.lang.Long getAccountId()
          Gets the account id for this Video.
 java.util.Date getCreationDate()
          Gets the creation date for this Video.
 java.util.List<CuePoint> getCuePoints()
          Gets the cue points for this Video.
 java.util.List<CustomField> getCustomFields()
          Gets the custom fields for this Video.
 EconomicsEnum getEconomics()
          Gets the economics for this Video.
 java.util.Date getEndDate()
          Gets the end date for this Video.
 java.lang.String getFlvUrl()
          Gets the FLV URL for this Video.
 java.lang.Boolean getGeoFiltered()
          Gets the geo filtered state for this Video.
 java.util.List<GeoFilterCodeEnum> getGeoFilteredCountries()
          Gets the geo-filtered countries for this Video.
 java.lang.Boolean getGeoFilteredExclude()
          Gets the geo filtered exclude state for this Video.
 java.lang.Long getId()
          Gets the id for this Video.
 ItemStateEnum getItemState()
          Gets the item state for this Video.
 java.util.Date getLastModifiedDate()
          Gets the last modified date for this Video.
 java.lang.Long getLength()
          Gets the length for this Video.
 java.lang.String getLinkText()
          Gets the related link text for this Video.
 java.lang.String getLinkUrl()
          Gets the related link URL for this Video.
 java.lang.String getLongDescription()
          Gets the long description for this Video.
 java.lang.String getName()
          Gets the name (title) for this Video.
 java.lang.Integer getPlaysTotal()
          Gets the plays total count for this Video.
 java.lang.Integer getPlaysTrailingWeek()
          Gets the plays trailing week count for this Video.
 java.util.Date getPublishedDate()
          Gets the published date for this Video.
 java.lang.String getReferenceId()
          Gets the reference id for this Video.
 java.util.Date getReleaseDate()
          Gets the release date for this Video.
 java.util.List<Rendition> getRenditions()
          Gets the renditions for this Video.
 java.lang.String getShortDescription()
          Gets the short description for this Video.
 java.util.Date getStartDate()
          Gets the start date for this Video.
 java.util.List<java.lang.String> getTags()
          Gets the keyword tags for this Video.
 java.lang.String getThumbnailUrl()
          Gets the thumbnail URL for this Video.
 Rendition getVideoFullLength()
          Gets the full length rendition for this Video.
 java.lang.String getVideoStillUrl()
          Gets the video still URL for this Video.
 void initAll()
          Fully initializes the video object by setting all fields to null
 void setAccountId(java.lang.Long accountId)
          Sets the account id for this Video.
 void setCreationDate(java.util.Date creationDate)
          Sets the creation date for this Video.
 void setCuePoints(java.util.List<CuePoint> cuePoints)
          Sets the cue points for this Video.
 void setCustomFields(java.util.List<CustomField> customFields)
          Sets the custom fields for this Video.
 void setEconomics(EconomicsEnum economics)
          Sets the economics for this Video.
 void setEndDate(java.util.Date endDate)
          Sets the end date for this Video.
 void setFlvUrl(java.lang.String flvUrl)
          Sets the FLV URL for this Video.
 void setGeoFiltered(java.lang.Boolean geoFiltered)
          Sets the geo filtered state for this Video.
 void setGeoFilteredCountries(java.util.List<GeoFilterCodeEnum> geoFilteredCountries)
          Sets the geo-filtered countries for this Video.
 void setGeoFilteredExclude(java.lang.Boolean geoFilteredExclude)
          Sets the geo filtered exclude state for this Video.
 void setId(java.lang.Long id)
          Sets the id for this Video.
 void setItemState(ItemStateEnum itemState)
          Sets the item state for this Video.
 void setLastModifiedDate(java.util.Date lastModifiedDate)
          Sets the last modified date for this Video.
 void setLength(java.lang.Long length)
          Sets the length for this Video.
 void setLinkText(java.lang.String linkText)
          Sets the related link text for this Video.
 void setLinkUrl(java.lang.String linkUrl)
          Sets the related link URL for this Video.
 void setLongDescription(java.lang.String longDescription)
          Sets the long description for this Video.
 void setName(java.lang.String name)
          Sets the name (title) for this Video.
 void setPlaysTotal(java.lang.Integer playsTotal)
          Sets the plays total count for this Video.
 void setPlaysTrailingWeek(java.lang.Integer playsTrailingWeek)
          Sets the plays trailing week count for this Video.
 void setPublishedDate(java.util.Date publishedDate)
          Sets the published date for this Video.
 void setReferenceId(java.lang.String referenceId)
          Sets the reference id for this Video.
 void setReleaseDate(java.util.Date releaseDate)
          Sets the release date for this Video.
 void setRenditions(java.util.List<Rendition> renditions)
          Sets the renditions for this Video.
 void setShortDescription(java.lang.String shortDescription)
          Sets the short description for this Video.
 void setStartDate(java.util.Date startDate)
          Sets the start date for this Video.
 void setTags(java.util.List<java.lang.String> tags)
          Sets the keyword tags for this Video.
 void setThumbnailUrl(java.lang.String thumbnailUrl)
          Sets the thumbnail URL for this Video.
 void setVideoFullLength(Rendition videoFullLength)
          Sets the full length rendition for this Video.
 void setVideoStillUrl(java.lang.String videoStillUrl)
          Sets the video still URL for this Video.
 JSONObject toJson()
          Converts the video into a JSON object suitable for use with the Media API
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Video

public Video()

Default Constructor.

All fields set to null to start - required fields must be set before calling Write Media API.


Video

public Video(java.lang.String json)
      throws JSONException

Constructor using JSON string.

Given a JSON string from the Media API, attempts to construct a new Video object and fill out all of the fields defined. All other fields will be null.

Throws:
JSONException

Video

public Video(JSONObject jsonObj)
      throws JSONException

Constructor using JSON object.

Given a JSON object from the Media API, attempts to construct a new Video object and fill out all of the fields defined. All other fields will be null.

Throws:
JSONException
Method Detail

initAll

public void initAll()

Fully initializes the video object by setting all fields to null


getName

public java.lang.String getName()

Gets the name (title) for this Video.

The title of this Video, limited to 60 characters. The name is a required property when you create a video.

Returns:
Name of the Video

getId

public java.lang.Long getId()

Gets the id for this Video.

A number that uniquely identifies this Video, assigned by Brightcove when the Video is created.

Returns:
The id for this Video

getReferenceId

public java.lang.String getReferenceId()

Gets the reference id for this Video.

A user-specified id that uniquely identifies this Video, limited to 150 characters. A referenceID can be used as a foreign-key to identify this video in another system.

Returns:
Reference id for this Video

getAccountId

public java.lang.Long getAccountId()

Gets the account id for this Video.

A number, assigned by Brightcove, that uniquely identifies the account to which this Video belongs.

Returns:
Account id for this Video

getShortDescription

public java.lang.String getShortDescription()

Gets the short description for this Video.

A short description describing this Video, limited to 250 characters. The shortDescription is a required property when you create a video.

Returns:
Short description for this Video

getLongDescription

public java.lang.String getLongDescription()

Gets the long description for this Video.

A longer description of this Video, limited to 5000 characters.

Returns:
Long description for this Video

getFlvUrl

public java.lang.String getFlvUrl()

Gets the FLV URL for this Video.

The URL of the video file for this Video. Note that this property can be accessed with the Media API only with a special read or write token. This property applies, no matter whether the video's encoding is FLV (VP6) or MP4 (H.264). See Accessing Video Content with the Media API.

Returns:
FLV URL for this Video

getCreationDate

public java.util.Date getCreationDate()

Gets the creation date for this Video.

The date this Video was created, represented as the number of milliseconds since the UNIX epoch.

Returns:
Creation date for this Video

getPublishedDate

public java.util.Date getPublishedDate()

Gets the published date for this Video.

The date this Video was last made active, represented as the number of milliseconds since the Unix epoch.

Returns:
Published date for this Video

getLastModifiedDate

public java.util.Date getLastModifiedDate()

Gets the last modified date for this Video.

The date this Video was last modified, represented as the number of milliseconds since the Unix epoch.

Returns:
Last modified date for this Video

getReleaseDate

public java.util.Date getReleaseDate()

Gets the release date for this Video.

Note: This field is undocumented in the BC documentation as of 2009/10/06, but does appear on videos in some accounts.

Returns:
Release date for this Video

getStartDate

public java.util.Date getStartDate()

Gets the start date for this Video.

The first date this Video is available to be played, represented as the number of milliseconds since the Unix epoch.

Returns:
Start date for this Video

getEndDate

public java.util.Date getEndDate()

Gets the end date for this Video.

The last date this Video is available to be played, represented as the number of milliseconds since the Unix epoch.

Returns:
End date for this Video

getLinkUrl

public java.lang.String getLinkUrl()

Gets the related link URL for this Video.

An optional URL to a related item, limited to 150 characters.

Returns:
Link URL for this Video

getLinkText

public java.lang.String getLinkText()

Gets the related link text for this Video.

The text displayed for the linkURL, limited to 40 characters.

Returns:
Link text for this Video

getVideoStillUrl

public java.lang.String getVideoStillUrl()

Gets the video still URL for this Video.

The URL to the video still image associated with this Video. Video stills are 480x360 pixels.

Returns:
Video still URL for this Video

getThumbnailUrl

public java.lang.String getThumbnailUrl()

Gets the thumbnail URL for this Video.

The URL to the thumbnail image associated with this Video. Thumbnails are 120x90 pixels.

Returns:
Thumbnail URL for this Video

getLength

public java.lang.Long getLength()

Gets the length for this Video.

The length of this video in milliseconds.

Returns:
Length for this Video

getGeoFiltered

public java.lang.Boolean getGeoFiltered()

Gets the geo filtered state for this Video.

True indicates that the video is geo-restricted.

Returns:
Geo filtered state for this Video

getGeoFilteredExclude

public java.lang.Boolean getGeoFilteredExclude()

Gets the geo filtered exclude state for this Video.

If true, the video can be viewed in all countries except those listed in geoFilteredCountries; if false, the video can be viewed only in the countries listed in geoFilteredCountries.

Returns:
Geo filtered exclude state for this Video

getPlaysTotal

public java.lang.Integer getPlaysTotal()

Gets the plays total count for this Video.

How many times this Video has been played since its creation.

Returns:
Plays total count for this Video

getPlaysTrailingWeek

public java.lang.Integer getPlaysTrailingWeek()

Gets the plays trailing week count for this Video.

How many times this Video has been played within the past seven days, exclusive of today.

Returns:
Plays trailing week count for this Video

getRenditions

public java.util.List<Rendition> getRenditions()

Gets the renditions for this Video.

An array of Renditions that represent the dynamic delivery renditions available for this Video. A Video should have not more than 10 Renditions. Note that this property can be accessed with the Media API only with a special read or write token. See Accessing Video Content with the Media API.

Returns:
List of renditions for this Video

getVideoFullLength

public Rendition getVideoFullLength()

Gets the full length rendition for this Video.

A single Rendition that represents the the video file for this Video. Note that this property can be accessed with the Media API only with a special read or write token. See Accessing Video Content with the Media API.

Returns:
The full length rendition for this Video

getItemState

public ItemStateEnum getItemState()

Gets the item state for this Video.

An ItemStateEnum. One of ACTIVE, INACTIVE, or DELETED. You can set this property only to ACTIVE or INACTIVE; you cannot delete a video by setting its itemState to DELETED.

Returns:
The item state for this Video

getTags

public java.util.List<java.lang.String> getTags()

Gets the keyword tags for this Video.

A list of Strings representing the tags assigned to this Video. Each tag can be not more than 64 characters, and a video can have no more than 1200 tags.

Returns:
The keyword tags for this Video

getEconomics

public EconomicsEnum getEconomics()

Gets the economics for this Video.

An EconomicsEnum. Either FREE or AD_SUPPORTED. AD_SUPPORTED means that ad requests are enabled for this Video.

Returns:
The economics for this Video

getGeoFilteredCountries

public java.util.List<GeoFilterCodeEnum> getGeoFilteredCountries()

Gets the geo-filtered countries for this Video.

A list of the ISO-3166 two-letter codes of the countries to enforce geo-restriction rules on. Use lowercase for the country codes.

Returns:
The geo-filtered countries for this Video

getCuePoints

public java.util.List<CuePoint> getCuePoints()

Gets the cue points for this Video.

A List of the CuePoints objects assigned to this Video.

Returns:
The cue points for this Video

getCustomFields

public java.util.List<CustomField> getCustomFields()

Gets the custom fields for this Video.

This feature is not explicitly documented in the Brightcove documentation

Returns:
The list of custom fields to use for this video

setName

public void setName(java.lang.String name)

Sets the name (title) for this Video.

The title of this Video, limited to 60 characters. The name is a required property when you create a video.

Parameters:
name - Name of the Video

setId

public void setId(java.lang.Long id)

Sets the id for this Video.

A number that uniquely identifies this Video, assigned by Brightcove when the Video is created.

Parameters:
id - The id for this Video

setReferenceId

public void setReferenceId(java.lang.String referenceId)

Sets the reference id for this Video.

A user-specified id that uniquely identifies this Video, limited to 150 characters. A referenceID can be used as a foreign-key to identify this video in another system.

Parameters:
referenceId - Reference id for this Video

setAccountId

public void setAccountId(java.lang.Long accountId)

Sets the account id for this Video.

A number, assigned by Brightcove, that uniquely identifies the account to which this Video belongs.

Parameters:
accountId - Account id for this Video

setShortDescription

public void setShortDescription(java.lang.String shortDescription)

Sets the short description for this Video.

A short description describing this Video, limited to 250 characters. The shortDescription is a required property when you create a video.

Parameters:
shortDescription - Short description for this Video

setLongDescription

public void setLongDescription(java.lang.String longDescription)

Sets the long description for this Video.

A longer description of this Video, limited to 5000 characters.

Parameters:
longDescription - Long description for this Video

setFlvUrl

public void setFlvUrl(java.lang.String flvUrl)

Sets the FLV URL for this Video.

The URL of the video file for this Video. Note that this property can be accessed with the Media API only with a special read or write token. This property applies, no matter whether the video's encoding is FLV (VP6) or MP4 (H.264). See Accessing Video Content with the Media API.

Parameters:
flvUrl - FLV URL for this Video

setCreationDate

public void setCreationDate(java.util.Date creationDate)

Sets the creation date for this Video.

The date this Video was created, represented as the number of milliseconds since the UNIX epoch.

Parameters:
creationDate - Creation date for this Video

setPublishedDate

public void setPublishedDate(java.util.Date publishedDate)

Sets the published date for this Video.

The date this Video was last made active, represented as the number of milliseconds since the Unix epoch.

Parameters:
publishedDate - Published date for this Video

setLastModifiedDate

public void setLastModifiedDate(java.util.Date lastModifiedDate)

Sets the last modified date for this Video.

The date this Video was last modified, represented as the number of milliseconds since the Unix epoch.

Parameters:
lastModifiedDate - Last modified date for this Video

setReleaseDate

public void setReleaseDate(java.util.Date releaseDate)

Sets the release date for this Video.

Note: This field is undocumented in the BC documentation as of 2009/10/06, but does appear on videos in some accounts.

Parameters:
releaseDate - Release date for this Video

setStartDate

public void setStartDate(java.util.Date startDate)

Sets the start date for this Video.

The first date this Video is available to be played, represented as the number of milliseconds since the Unix epoch.

Parameters:
startDate - Start date for this Video

setEndDate

public void setEndDate(java.util.Date endDate)

Sets the end date for this Video.

The last date this Video is available to be played, represented as the number of milliseconds since the Unix epoch.

Parameters:
endDate - End date for this Video

setLinkUrl

public void setLinkUrl(java.lang.String linkUrl)

Sets the related link URL for this Video.

An optional URL to a related item, limited to 150 characters.

Parameters:
linkUrl - Link URL for this Video

setLinkText

public void setLinkText(java.lang.String linkText)

Sets the related link text for this Video.

The text displayed for the linkURL, limited to 40 characters.

Parameters:
linkText - Link text for this Video

setVideoStillUrl

public void setVideoStillUrl(java.lang.String videoStillUrl)

Sets the video still URL for this Video.

The URL to the video still image associated with this Video. Video stills are 480x360 pixels.

Parameters:
videoStillUrl - Video still URL for this Video

setThumbnailUrl

public void setThumbnailUrl(java.lang.String thumbnailUrl)

Sets the thumbnail URL for this Video.

The URL to the thumbnail image associated with this Video. Thumbnails are 120x90 pixels.

Parameters:
thumbnailUrl - Thumbnail URL for this Video

setLength

public void setLength(java.lang.Long length)

Sets the length for this Video.

The length of this video in milliseconds.

Parameters:
length - Length for this Video

setGeoFiltered

public void setGeoFiltered(java.lang.Boolean geoFiltered)

Sets the geo filtered state for this Video.

True indicates that the video is geo-restricted.

Parameters:
geoFiltered - Geo filtered state for this Video

setGeoFilteredExclude

public void setGeoFilteredExclude(java.lang.Boolean geoFilteredExclude)

Sets the geo filtered exclude state for this Video.

If true, the video can be viewed in all countries except those listed in geoFilteredCountries; if false, the video can be viewed only in the countries listed in geoFilteredCountries.

Parameters:
geoFilteredExclude - Geo filtered exclude state for this Video

setPlaysTotal

public void setPlaysTotal(java.lang.Integer playsTotal)

Sets the plays total count for this Video.

How many times this Video has been played since its creation.

Parameters:
playsTotal - Plays total count for this Video

setPlaysTrailingWeek

public void setPlaysTrailingWeek(java.lang.Integer playsTrailingWeek)

Sets the plays trailing week count for this Video.

How many times this Video has been played within the past seven days, exclusive of today.

Parameters:
playsTrailingWeek - Plays trailing week count for this Video

setRenditions

public void setRenditions(java.util.List<Rendition> renditions)

Sets the renditions for this Video.

An array of Renditions that represent the dynamic delivery renditions available for this Video. A Video should have not more than 10 Renditions. Note that this property can be accessed with the Media API only with a special read or write token. See Accessing Video Content with the Media API.

Parameters:
renditions - List of renditions for this Video

setVideoFullLength

public void setVideoFullLength(Rendition videoFullLength)

Sets the full length rendition for this Video.

A single Rendition that represents the the video file for this Video. Note that this property can be accessed with the Media API only with a special read or write token. See Accessing Video Content with the Media API.

Parameters:
videoFullLength - The full length rendition for this Video

setItemState

public void setItemState(ItemStateEnum itemState)

Sets the item state for this Video.

An ItemStateEnum. One of ACTIVE, INACTIVE, or DELETED. You can set this property only to ACTIVE or INACTIVE; you cannot delete a video by setting its itemState to DELETED.

Parameters:
itemState - The item state for this Video

setTags

public void setTags(java.util.List<java.lang.String> tags)

Sets the keyword tags for this Video.

A list of Strings representing the tags assigned to this Video. Each tag can be not more than 64 characters, and a video can have no more than 1200 tags.

Parameters:
tags - The keyword tags for this Video

setEconomics

public void setEconomics(EconomicsEnum economics)

Sets the economics for this Video.

An EconomicsEnum. Either FREE or AD_SUPPORTED. AD_SUPPORTED means that ad requests are enabled for this Video.

Parameters:
economics - The economics for this Video

setGeoFilteredCountries

public void setGeoFilteredCountries(java.util.List<GeoFilterCodeEnum> geoFilteredCountries)

Sets the geo-filtered countries for this Video.

A list of the ISO-3166 two-letter codes of the countries to enforce geo-restriction rules on. Use lowercase for the country codes.

Parameters:
geoFilteredCountries - The geo-filtered countries for this Video

setCuePoints

public void setCuePoints(java.util.List<CuePoint> cuePoints)

Sets the cue points for this Video.

A List of the CuePoints objects assigned to this Video.

Parameters:
cuePoints - The cue points for this Video

setCustomFields

public void setCustomFields(java.util.List<CustomField> customFields)

Sets the custom fields for this Video.

This feature is not explicitly documented in the Brightcove documentation

Parameters:
customFields - The list of custom fields to use for this video

toJson

public JSONObject toJson()
                  throws JSONException

Converts the video into a JSON object suitable for use with the Media API

Returns:
JSON object representing the video
Throws:
JSONException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object