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

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

public class Rendition
extends java.lang.Object

Represents a Rendition object to/from the Media API.

From the Brightcove documentation on 2010/08/15 (http://support.brightcove.com/en/docs/media-api-objects-reference):
The Rendition object represents one of the dynamic delivery renditions of a video. A Video should have not more than 10 Renditions. For more information, see Using dynamic delivery and Creating videos for dynamic delivery.

property name type read only? description
url String yes The URL of the rendition file.
controllerType enum no [Optional required for live streaming only] Depending on your CDN, one of the following values: LIMELIGHT_LIVE or AKAMAI_LIVE.
encodingRate int yes The rendition's encoding rate, in bits per second.
frameHeight int yes The rendition's display height, in pixels.
frameWidth int yes The rendition's display width, in pixels.
size long yes Required. The file size of the rendition, in bytes.
remoteUrl string no Required, for remote assets. The complete path to the file hosted on the remote server. If the file is served using progressive download, then you must include the file name and extension for the file. You can also use a URL that re-directs to a URL that includes the file name and extension. If the file is served using Flash streaming, use the remoteStreamName attribute to provide the stream name.
remoteStreamName string no [Optional - required for streaming remote assets only] A stream name for Flash streaming appended to the value of the remoteUrl property.
videoDuration long no Required. The length of the remote video asset in milliseconds.
videoCodec enum no Required. Valid values are SORENSON, ON2, and H264.

Author:
Sander Gates

Constructor Summary
Rendition()
          Default Constructor.
Rendition(java.lang.String json)
          Constructor using JSON string.
 
Method Summary
 java.lang.Boolean getAudioOnly()
          Gets whether or not this rendition is audio only.
 ControllerTypeEnum getControllerType()
          Gets the Controller Type for this Rendition.
 java.lang.String getDisplayName()
          Gets the display name for this Rendition.
 java.lang.Integer getEncodingRate()
          Gets the encoding rate for this Rendition.
 java.lang.Integer getFrameHeight()
          Gets the frame height for this Rendition in pixels.
 java.lang.Integer getFrameWidth()
          Gets the frame width for this Rendition in pixels.
 java.lang.Long getId()
           
 java.lang.String getReferenceId()
           
 java.lang.String getRemoteStreamName()
          Gets the remote stream name attribute for this Rendition.
 java.lang.String getRemoteUrl()
          Gets the remote URL attribute for this asset.
 java.lang.Long getSize()
          Gets the file size of this Rendition in bytes.
 java.lang.Long getUploadTimestampMillis()
           
 java.lang.String getUrl()
          Gets the URL for this Rendition.
 VideoCodecEnum getVideoCodec()
          Gets the video codec for this Rendition.
 java.lang.String getVideoContainer()
           
 java.lang.Long getVideoDuration()
          Gets the length of the video asset.
 void initAll()
          Sets all variables to null.
 void setAudioOnly(java.lang.Boolean audioOnly)
          Sets whether or not this rendition is audio only.
 void setControllerType(ControllerTypeEnum controllerType)
          Sets the Controller Type for this Rendition.
 void setDisplayName(java.lang.String displayName)
          Sets the display name for this Rendition.
 void setEncodingRate(java.lang.Integer encodingRate)
          Sets the encoding rate for this Rendition.
 void setFrameHeight(java.lang.Integer frameHeight)
          Sets the frame height for this Rendition in pixels.
 void setFrameWidth(java.lang.Integer frameWidth)
          Sets the frame width for this Rendition in pixels.
 void setId(java.lang.Long id)
           
 void setReferenceId(java.lang.String referenceId)
           
 void setRemoteStreamName(java.lang.String remoteStreamName)
          Sets the remote stream name attribute for this Rendition.
 void setRemoteUrl(java.lang.String remoteUrl)
          Sets the remote URL attribute for this asset.
 void setSize(java.lang.Long size)
          Sets the file size of this Rendition in bytes.
 void setUploadTimestampMillis(java.lang.Long uploadTimestampMillis)
           
 void setUrl(java.lang.String url)
          Sets the URL for this Rendition.
 void setVideoCodec(VideoCodecEnum videoCodec)
          Sets the video codec for this Rendition.
 void setVideoContainer(java.lang.String videoContainer)
           
 void setVideoDuration(java.lang.Long videoDuration)
          Sets the length of the video asset.
 JSONObject toJson()
          Converts the rendition 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

Rendition

public Rendition()

Default Constructor.

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


Rendition

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

Constructor using JSON string.

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

Throws:
JSONException
Method Detail

initAll

public void initAll()

Sets all variables to null.


getUrl

public java.lang.String getUrl()

Gets the URL for this Rendition.

The URL of the rendition file.

Returns:
Rendition URL as a String

setUrl

public void setUrl(java.lang.String url)

Sets the URL for this Rendition.

The URL of the rendition file.

Parameters:
url - String representing the Rendition URL

getControllerType

public ControllerTypeEnum getControllerType()

Gets the Controller Type for this Rendition.

The Controller Type of the rendition file.

Returns:
Controller Type enumeration value

setControllerType

public void setControllerType(ControllerTypeEnum controllerType)

Sets the Controller Type for this Rendition.

[Optional required for live streaming only] Depending on your CDN, one of the following values: LIMELIGHT_LIVE or AKAMAI_LIVE.

Parameters:
controllerType - Enumeration value for the controller type

getEncodingRate

public java.lang.Integer getEncodingRate()

Gets the encoding rate for this Rendition.

The rendition's encoding rate, in bits per second.

Returns:
Encoding rate for this Rendition, in bits/second

setEncodingRate

public void setEncodingRate(java.lang.Integer encodingRate)

Sets the encoding rate for this Rendition.

The rendition's encoding rate, in bits per second.

Parameters:
encodingRate - Encoding rate for this Rendition, in bits/second

getDisplayName

public java.lang.String getDisplayName()

Gets the display name for this Rendition.

The display name of the rendition file.

Returns:
Rendition display name as a String

setDisplayName

public void setDisplayName(java.lang.String displayName)

Sets the display name for this Rendition.

The display name of the rendition file.

Parameters:
displayName -

getFrameHeight

public java.lang.Integer getFrameHeight()

Gets the frame height for this Rendition in pixels.

The rendition's display height, in pixels.

Returns:
Frame height for this Rendition in pixels

setFrameHeight

public void setFrameHeight(java.lang.Integer frameHeight)

Sets the frame height for this Rendition in pixels.

The rendition's display height, in pixels.

Parameters:
frameHeight - Frame height for this Rendition in pixels

getFrameWidth

public java.lang.Integer getFrameWidth()

Gets the frame width for this Rendition in pixels.

The rendition's display width, in pixels.

Returns:
Frame width for this Rendition in pixels

setFrameWidth

public void setFrameWidth(java.lang.Integer frameWidth)

Sets the frame width for this Rendition in pixels.

The rendition's display width, in pixels.

Parameters:
frameWidth - Frame width for this Rendition in pixels

getSize

public java.lang.Long getSize()

Gets the file size of this Rendition in bytes.

Required. The file size of the rendition, in bytes.

Returns:
File size in bytes for this Rendition

setSize

public void setSize(java.lang.Long size)

Sets the file size of this Rendition in bytes.

Required. The file size of the rendition, in bytes.

Parameters:
size - File size in bytes for this Rendition

getRemoteUrl

public java.lang.String getRemoteUrl()

Gets the remote URL attribute for this asset.

Required, for remote assets. The complete path to the file hosted on the remote server. If the file is served using progressive download, then you must include the file name and extension for the file. You can also use a URL that re-directs to a URL that includes the file name and extension. If the file is served using Flash streaming, use the remoteStreamName attribute to provide the stream name.

Returns:
Remote URL attribute for this asset as a String

setRemoteUrl

public void setRemoteUrl(java.lang.String remoteUrl)

Sets the remote URL attribute for this asset.

Required, for remote assets. The complete path to the file hosted on the remote server. If the file is served using progressive download, then you must include the file name and extension for the file. You can also use a URL that re-directs to a URL that includes the file name and extension. If the file is served using Flash streaming, use the remoteStreamName attribute to provide the stream name.

Parameters:
remoteUrl - Remote URL attribute for this asset as a String

getRemoteStreamName

public java.lang.String getRemoteStreamName()

Gets the remote stream name attribute for this Rendition.

[Optional - required for streaming remote assets only] A stream name for Flash streaming appended to the value of the remoteUrl property.

Returns:
Remote stream name

setRemoteStreamName

public void setRemoteStreamName(java.lang.String remoteStreamName)

Sets the remote stream name attribute for this Rendition.

[Optional - required for streaming remote assets only] A stream name for Flash streaming appended to the value of the remoteUrl property.

Parameters:
remoteStreamName - Remote stream name

getVideoDuration

public java.lang.Long getVideoDuration()

Gets the length of the video asset.

Required. The length of the remote video asset in milliseconds.

Returns:
The length of the video asset in milliseconds

setVideoDuration

public void setVideoDuration(java.lang.Long videoDuration)

Sets the length of the video asset.

Required. The length of the remote video asset in milliseconds.

Parameters:
videoDuration - the length of the video asset in milliseconds

getVideoCodec

public VideoCodecEnum getVideoCodec()

Gets the video codec for this Rendition.

Required. Valid values are SORENSON, ON2, and H264.

Returns:
Video codec for this Rendition

setVideoCodec

public void setVideoCodec(VideoCodecEnum videoCodec)

Sets the video codec for this Rendition.

Required. Valid values are SORENSON, ON2, and H264.

Parameters:
videoCodec - Video codec for this Rendition

getAudioOnly

public java.lang.Boolean getAudioOnly()

Gets whether or not this rendition is audio only.

Returns:
Boolean (true if the rendition is audio only, else false)

setAudioOnly

public void setAudioOnly(java.lang.Boolean audioOnly)

Sets whether or not this rendition is audio only.

Parameters:
audioOnly - True if the rendition is audio only, else false

getId

public java.lang.Long getId()

setId

public void setId(java.lang.Long id)

getReferenceId

public java.lang.String getReferenceId()

setReferenceId

public void setReferenceId(java.lang.String referenceId)

getUploadTimestampMillis

public java.lang.Long getUploadTimestampMillis()

setUploadTimestampMillis

public void setUploadTimestampMillis(java.lang.Long uploadTimestampMillis)

getVideoContainer

public java.lang.String getVideoContainer()

setVideoContainer

public void setVideoContainer(java.lang.String videoContainer)

toJson

public JSONObject toJson()
                  throws JSONException

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

Returns:
JSON object representing the rendition
Throws:
JSONException

toString

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