Class Index | File Index

Classes


Class brightcove.api.modules.CuePointsModule


Extends brightcove.api.modules.APIModule.

Defined in: SmartPlayerAPI.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
API class for handling adding and managing cue points.
Propertys borrowed from class brightcove.api.modules.APIModule:
experience
Propertys borrowed from class brightcove.api.modules.APIModule:
experience
Function Summary
Function Attributes Function Name and Description
 
addCuePoints(id, cuePoints)
Adds a set of cue points to a specified video.
 
addEventListener(event, handler, priority)
Adds an event handler for the specified event.
 
Clears all ad cue points for a specified video.
 
Clears all code cue points for a specified video.
 
getCuePoints(id, callback)
Invokes the callback with the cue points for a specified video, if any.
 
Removes ad cue points at the specified time for the specified video.
 
Removes code cue points at the specified time for the specified video.
 
removeEventListener(event, handler)
Removes the event handler for the specified event.
Class Detail
brightcove.api.modules.CuePointsModule(experience)
API class for handling adding and managing cue points. To obtain a reference call:
var APIModules = brightcove.api.modules.APIModules;
var cuePointsModule = experience.getModule(APIModules.CUE_POINTS);
Parameters:
experience
Function Detail
addCuePoints(id, cuePoints)
Adds a set of cue points to a specified video. These cuepoints will cause cuePoint events to fire at the times specified, which the user can subscribe to. This method adds cue points just in the current client session. It does not persist cue points to the backend for the video.
var videoID = 123456; // id of video currently in player
var cuePoints = [5, 10, 30];
// alternatively:
// var CuePointType = brightcove.api.modules.CuePointsModule.CuePointType;
// var cuePoints = [
//        {time:5, type:CuePointType.CODE}, 
//        {time:10, type:CuePointType.CODE}
//    ];

var APIModules = brightcove.api.modules.APIModules;
var cuePointsModule = experience.getModule(APIModules.CUE_POINTS);
cuePointsModule.addCuePoints(videoID, cuePoints);
Parameters:
{number} id
VideoDTO id for the video to have cuepoints added to.
{array} cuePoints
An array of objects defining points in time. Each index of the array can either be a number, specifying the time in seconds for the cue, or each index can contain a complex object with time (in seconds), type and description properties.

addEventListener(event, handler, priority)
Adds an event handler for the specified event.
var APIModules = brightcove.api.modules.APIModules;
var videoPlayer = experience.getModule(APIModules.VIDEO_PLAYER);
videoPlayer.addEventListener(
      brightcove.api.events.MediaEvent.COMPLETE, 
      myCompleteHandler);
Parameters:
{string} event
The name of the event to listen for.
{function} handler
The handler to invoke when the event fires.
{number} priority
The priority of the handler (lower number is higher priority). Default is 0. optional

clearAdCuePoints(id)
Clears all ad cue points for a specified video.
var videoID = 123456; // id of video currently in player

var APIModules = brightcove.api.modules.APIModules;
var cuePointsModule = experience.getModule(APIModules.CUE_POINTS);
cuePointsModule.clearAdCuePoints(videoID);
Parameters:
{number} id
VideoDTO id for the video to remove ad cue points from.

clearCodeCuePoints(id)
Clears all code cue points for a specified video.
var videoID = 123456; // id of video currently in player

var APIModules = brightcove.api.modules.APIModules;
var cuePointsModule = experience.getModule(APIModules.CUE_POINTS);
cuePointsModule.clearCodeCuePoints(videoID);
Parameters:
{number} id
VideoDTO id for the video to remove code cue points from.

getCuePoints(id, callback)
Invokes the callback with the cue points for a specified video, if any. The cue points are not guaranteed to be in any specific order.
var cuePoints; // will hold array of cue points
function cuePointsHandler(result) {
    cuePoints = result;
}

var videoID = 123456; // id of video currently in player

var APIModules = brightcove.api.modules.APIModules;
var cuePointsModule = experience.getModule(APIModules.CUE_POINTS);
cuePointsModule.getCuePoints(videoID, cuePointsHandler);

If you are building a JS plugin, you can call this method synchronously 
without the callback parameter.

var cuePoints = cuePointsModule.getCuePoints("123");
Parameters:
{number} id
VideoDTO id for the video to retrieve code cue points for.
{function} callback
The callback function to invoke with the array of cue points for the specified video.

removeAdCuePointsAtTime(id, time)
Removes ad cue points at the specified time for the specified video.
var videoID = 123456; // id of video currently in player
var time = 5; // time in seconds to remove cue points from

var APIModules = brightcove.api.modules.APIModules;
var cuePointsModule = experience.getModule(APIModules.CUE_POINTS);
cuePointsModule.removeAdCuePointsAtTime(videoID, time);
Parameters:
{number} id
VideoDTO id for the video to remove ad cue points from.
{number} time
The time of the cue point to remove, in seconds.

removeCodeCuePointsAtTime(id, time)
Removes code cue points at the specified time for the specified video.
var videoID = 123456; // id of video currently in player
var time = 5; // time in seconds to remove cue points from

var APIModules = brightcove.api.modules.APIModules;
var cuePointsModule = experience.getModule(APIModules.CUE_POINTS);
cuePointsModule.removeCodeCuePointsAtTime(videoID, time);
Parameters:
{number} id
VideoDTO id for the video to remove code cue points from.
{number} time
The time of the cue point to remove, in seconds.

removeEventListener(event, handler)
Removes the event handler for the specified event.
var APIModules = brightcove.api.modules.APIModules;
var videoPlayer = experience.getModule(APIModules.VIDEO_PLAYER);
videoPlayer.removeEventListener(
      brightcove.api.events.MediaEvent.PROGRESS, 
      myProgressHandler);
Parameters:
{string} event
The name of the event to listen for.
{function} handler
The handler to invoke when the event fires.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Nov 20 2013 14:17:46 GMT-0500 (EST)