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

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

public class CuePoint
extends java.lang.Object

Represents a Cue Point 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 CuePoint object is a marker set at a precise time point in the duration of a video. You can use cue points to trigger mid-roll ads or to separate chapters or scenes in a long-form video. For more information, see Adding Cue Points to Videos and Setting CuePoints with the Media API.

property name type read only? description
name String yes Required. A name for the cue point, so that you can refer to it.
videoId String yes A comma-separated list of the ids of one or more videos that this cue point applies to.
time Long yes Required. The time of the cue point, measured in milliseconds from the beginning of the video.
forceStop Boolean no If true, the video stops playback at the cue point. This setting is valid only for AD type cue points.
type Enum yes Required. An integer code corresponding to the type of cue point. One of 0 (AD), 1 (CODE), or 2 (CHAPTER). An AD cue point is used to trigger mid-roll ad requests. A CHAPTER cue point indicates a chapter or scene break in the video. A CODE cue point causes an event that you can listen for and respond to.
metadata String no A string that can be passed along with a CODE cue point.

Author:
Sander Gates

Constructor Summary
CuePoint()
          Default Constructor.
CuePoint(java.lang.String json)
          Constructor using JSON string.
 
Method Summary
 java.lang.Boolean getForceStop()
          Gets the forceStop attribute of the Cue Point.
 java.lang.Long getId()
          Gets the id of the Cue Point.
 java.lang.String getMetadata()
          Gets the meta data on the Cue Point.
 java.lang.String getName()
          Gets the name of the Cue Point.
 java.lang.Long getTime()
          Gets the time of the Cue Point.
 CuePointTypeEnum getType()
          Gets the type of the Cue Point.
 java.lang.String getVideoId()
          Gets the unique id of the Cue Point.
 void InitAll()
          Initializes all variables to null
 void setForceStop(java.lang.Boolean forceStop)
          Sets the forceStop attribute of the Cue Point.
 void setId(java.lang.Long id)
          Sets the id of the Cue Point.
 void setMetadata(java.lang.String metadata)
          Sets the meta data on the Cue Point.
 void setName(java.lang.String name)
          Sets the name of the Cue Point.
 void setTime(java.lang.Long time)
          Sets the time of the Cue Point.
 void setType(CuePointTypeEnum type)
          Sets the type of the Cue Point.
 void setVideoId(java.lang.String videoId)
          Sets the unique id of the Cue Point.
 JSONObject toJson()
          Converts the cue point 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

CuePoint

public CuePoint()

Default Constructor.

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


CuePoint

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

Constructor using JSON string.

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

Throws:
JSONException
Method Detail

InitAll

public void InitAll()

Initializes all variables to null


getName

public java.lang.String getName()

Gets the name of the Cue Point.

Required. A name for the cue point, so that you can refer to it.

Returns:
Name of the Cue Point

setName

public void setName(java.lang.String name)

Sets the name of the Cue Point.

Required. A name for the cue point, so that you can refer to it.

Parameters:
name - Name of the Cue Point

getId

public java.lang.Long getId()

Gets the id of the Cue Point.

Returns:
id of the Cue Point

setId

public void setId(java.lang.Long id)

Sets the id of the Cue Point.

Parameters:
id - Id of the Cue Point

getVideoId

public java.lang.String getVideoId()

Gets the unique id of the Cue Point.

A comma-separated list of the ids of one or more videos that this cue point applies to.

Returns:
Comma-separated String of the ids of the Cue Point

setVideoId

public void setVideoId(java.lang.String videoId)

Sets the unique id of the Cue Point.

A comma-separated list of the ids of one or more videos that this cue point applies to.

Parameters:
videoId - Comma-separated String of the ids of the Cue Point

getTime

public java.lang.Long getTime()

Gets the time of the Cue Point.

Required. The time of the cue point, measured in milliseconds from the beginning of the video.

Returns:
Time (in milliseconds from the beginning of the video) of the Cue Point

setTime

public void setTime(java.lang.Long time)

Sets the time of the Cue Point.

Required. The time of the cue point, measured in milliseconds from the beginning of the video.

Parameters:
time - Time (in milliseconds from the beginning of the video) of the Cue Point

getForceStop

public java.lang.Boolean getForceStop()

Gets the forceStop attribute of the Cue Point.

If true, the video stops playback at the cue point. This setting is valid only for AD type cue points.

Returns:
forceStop attribute of the Cue Point

setForceStop

public void setForceStop(java.lang.Boolean forceStop)

Sets the forceStop attribute of the Cue Point.

If true, the video stops playback at the cue point. This setting is valid only for AD type cue points.

Parameters:
forceStop - forceStop attribute of the Cue Point

getType

public CuePointTypeEnum getType()

Gets the type of the Cue Point.

Required. An integer code corresponding to the type of cue point. One of 0 (AD), 1 (CODE), or 2 (CHAPTER). An AD cue point is used to trigger mid-roll ad requests. A CHAPTER cue point indicates a chapter or scene break in the video. A CODE cue point causes an event that you can listen for and respond to.

Returns:
Type of the Cue Point

setType

public void setType(CuePointTypeEnum type)

Sets the type of the Cue Point.

Required. An integer code corresponding to the type of cue point. One of 0 (AD), 1 (CODE), or 2 (CHAPTER). An AD cue point is used to trigger mid-roll ad requests. A CHAPTER cue point indicates a chapter or scene break in the video. A CODE cue point causes an event that you can listen for and respond to.

Parameters:
type - Type of the Cue Point

getMetadata

public java.lang.String getMetadata()

Gets the meta data on the Cue Point.

A string that can be passed along with a CODE cue point.

Returns:
Meta data on the Cue Point

setMetadata

public void setMetadata(java.lang.String metadata)

Sets the meta data on the Cue Point.

A string that can be passed along with a CODE cue point.

Parameters:
metadata - Meta data on the Cue Point

toJson

public JSONObject toJson()
                  throws JSONException

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

Returns:
JSON object representing the cue point
Throws:
JSONException

toString

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