Package | com.brightcove.api.modules |
Class | public class ContentModule |
Inheritance | ContentModule ![]() ![]() |
Method | Defined By | ||
---|---|---|---|
ContentModule(module:Object)
Constructor. | ContentModule | ||
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = true):void [override]
Adds a listener for an event. | APIModule | |
appendArgsToMediaRequest(argumentString:String):void
Appends the valid values from the query string to any media request from the player. | ContentModule | ||
createRuntimeMediaCollection(collection:Object, type:String):MediaCollectionDTO
Creates a media collection from the data passed in the custom object. | ContentModule | ||
getAllMediaCollectionIDs(collectionType:String):Array
Returns an array of ids for the media collections currently in the player. | ContentModule | ||
getAllMediaCollections(collectionType:String):Array
Returns an array of media collections currently in the player. | ContentModule | ||
Returns the media DTO for the ID or referenceID passed in if it is currently loaded in the player. | ContentModule | ||
getMediaAsynch(mediaId:Object, property:String):void
Fetches the media DTO from the server whose value for the specified property that matches the specified value. | ContentModule | ||
getMediaCollection(id:Object, property:String, page:uint = 0, recordsPerPage:uint = 50):MediaCollectionDTO
Returns the MediaCollectionDTO whose value for the specified property matches the specified value. | ContentModule | ||
getMediaCollectionAsynch(id:Object, property:String, page:uint = 0, recordsPerPage:uint = 50):void
Fetches from the server the MediaCollectionDTO whose value for the specified property matches the specified value. | ContentModule | ||
getMediaInGroupAsynch(ids:Array, property:String = id):void
Fetches multiple MediaDTOs from server, returning them in an array. | ContentModule | ||
getProgrammingForTarget(target:String):Object
Returns the programmed content for a specific content target in the player. | ContentModule | ||
purgeAllContent():void
Deletes all content from memory in the player. | ContentModule | ||
purgeMedia(... ids):Boolean
Removes the specified media from memory in the player. | ContentModule | ||
purgeMediaCollections(... ids):Boolean
Removes the specified media collections from memory in the player. | ContentModule | ||
![]() | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void [override]
Removes a listener for an event. | APIModule | |
updateMedia(media:Object):MediaDTO
Updates properties on an existing media object. | ContentModule |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when media is loaded through a call to getMediaCollectionAsynch(). | ContentModule | |||
Dispatched when media is loaded through a call to getMediaAsynch(). | ContentModule |
Constant | Defined By | ||
---|---|---|---|
AUDIO_TRACK_PLAYLIST : String = audioTrackPlaylist [static]
Value that filters the type returned by the getAllMediaCollections() or
getAllMediaCollectionIDs method to only include audio track playlists
when passed as the collectionType property. | ContentModule | ||
ID : String = id [static]
Value that retrieves media or media collections by ID when passed as the property
parameter of the getMedia(), getMediaAsync(),
getMediaCollection() or getMediaCollectionAsync() method. | ContentModule | ||
PLAYLIST : String = playlist [static]
Value that filters the type returned by the getAllMediaCollections() or
getAllMediaCollectionIDs method to only include video playlists
when passed as the collectionType property. | ContentModule | ||
REFERENCE_ID : String = referenceId [static]
Value that retrieves media or media collections by referenceID when passed as the property
parameter of the getMedia(), getMediaAsync(),
getMediaCollection() or getMediaCollectionAsync() method. | ContentModule |
ContentModule | () | Constructor |
public function ContentModule(module:Object)
Constructor.
Parametersmodule:Object — module to wrap with this API class.
|
appendArgsToMediaRequest | () | method |
public function appendArgsToMediaRequest(argumentString:String):void
Appends the valid values from the query string to any media request from the player. The form of the argument should be 'key=value&key=value&key=value'. Invalid keys include playerId, pubId, videoId, lineUpId, affiliateId.
Parameters
argumentString:String — The arguments to append.
|
createRuntimeMediaCollection | () | method |
public function createRuntimeMediaCollection(collection:Object, type:String):MediaCollectionDTO
Creates a media collection from the data passed in the custom object. The following properties can be set in the collection: mediaIds, displayName, shortDescription, longDescription, thumbnailURL
Parameters
collection:Object — object containing the values to populate in the new media collection.
| |
type:String — type of media collection to create.
|
MediaCollectionDTO — The new MediaCollectionDTO stored player side.
|
getAllMediaCollectionIDs | () | method |
public function getAllMediaCollectionIDs(collectionType:String):Array
Returns an array of ids for the media collections currently in the player.
Parameters
collectionType:String — The ID collection type to return ("playlist" or "audioTrackPlaylist").
Not setting this parameter will return all media collection IDs in the player.
|
Array — An array of media collection ids.
|
getAllMediaCollections | () | method |
public function getAllMediaCollections(collectionType:String):Array
Returns an array of media collections currently in the player.
Parameters
collectionType:String — The media collection type to return ("playlist" or "audioTrackPlaylist").
Not setting this parameter will return all media collections in the player.
|
Array — An array of MediaCollectionDTOs.
|
getMedia | () | method |
public function getMedia(mediaId:Object, property:String):MediaDTO
Returns the media DTO for the ID or referenceID passed in if it is currently loaded in the player.
Parameters
mediaId:Object — ID (Number) or referenceID (String) for the media to retrieve.
| |
property:String — property of the media DTO in which to check for the specified ID ("id" or "referenceId").
|
MediaDTO |
getMediaAsynch | () | method |
public function getMediaAsynch(mediaId:Object, property:String):void
Fetches the media DTO from the server whose value for the specified property that matches the specified value. Since this happens asynchronously, add a listener for the ContentEvent.MEDIA_LOAD event to know when this has completed.
Parameters
mediaId:Object — ID (Number) or referenceID (String) for the media to retrieve.
| |
property:String — property of the media DTO in which to check for the specified ID ("id" or "referenceId").
|
getMediaCollection | () | method |
public function getMediaCollection(id:Object, property:String, page:uint = 0, recordsPerPage:uint = 50):MediaCollectionDTO
Returns the MediaCollectionDTO whose value for the specified property matches the specified value.
Parameters
id:Object — ID (Number) or referenceID (String) for the media to retrieve.
| |
property:String — property of the media collections in which to check for the specified ID ("id" or "referenceId").
| |
page:uint (default = 0 ) — page to fetch in the array of media records. (Deprecated. See Media API docs for full paging support.)
| |
recordsPerPage:uint (default = 50 ) — number of records that should be fetched per page. The maximum and default number is 50. (Deprecated. See Media API docs for full paging support.)
|
MediaCollectionDTO — The MediaCollectionDTO that matches the search requirements.
|
getMediaCollectionAsynch | () | method |
public function getMediaCollectionAsynch(id:Object, property:String, page:uint = 0, recordsPerPage:uint = 50):void
Fetches from the server the MediaCollectionDTO whose value for the specified property matches the specified value. Since this happens asynchronously, add a listener for the ContentEvent.MEDIA_COLLECTION_LOAD event to know when this has completed. Download code examples for this method from the article, Dynamically Loading Media into Players for ActionScript and JavaScript.
Parameters
id:Object — ID (Number) or referenceID (String) for the media to retrieve.
| |
property:String — property of the media collections in which to check for the specified ID ("id" or "referenceId").
| |
page:uint (default = 0 ) — page to fetch in the array of media records. (Deprecated. See Media API docs for full paging support.)
| |
recordsPerPage:uint (default = 50 ) — number of records that should be fetched per page. The maximum and default number is 50. (Deprecated. See Media API docs for full paging support.)
|
getMediaInGroupAsynch | () | method |
public function getMediaInGroupAsynch(ids:Array, property:String = id):void
Fetches multiple MediaDTOs from server, returning them in an array. Since this happens asynchronously, add a listener for the ContentEvent.MEDIA_COLLECTION_LOAD event to know when this has completed. List must be completely ids or referenceIds, not a mixture of both. Download code examples for this method from the article, Dynamically Loading Media into Players for ActionScript and JavaScript.
Parameters
ids:Array — IDs of the media to retrieve and place in an array.
| |
property:String (default = id ) — "id" (default) or "referenceId". Determines how the media is searched for.
|
getProgrammingForTarget | () | method |
public function getProgrammingForTarget(target:String):Object
Returns the programmed content for a specific content target in the player.
Parameters
target:String — target key by which the content is stored.
|
Object — The content stored by the specified target key.
|
purgeAllContent | () | method |
public function purgeAllContent():void
Deletes all content from memory in the player.
purgeMedia | () | method |
public function purgeMedia(... ids):Boolean
Removes the specified media from memory in the player.
Parameters
... ids — ID(s) of the media to be removed.
|
Boolean — Whether the media existed and was successfully removed.
|
purgeMediaCollections | () | method |
public function purgeMediaCollections(... ids):Boolean
Removes the specified media collections from memory in the player.
Parameters
... ids — ID(s) of the media collections to be removed.
|
Boolean — Whether the media collections existed and were successfully removed.
|
updateMedia | () | method |
public function updateMedia(media:Object):MediaDTO
Updates properties on an existing media object. The media id in the given object must match existing media that has been loaded. Media changes will not show up if the media is playing, but it will show up the next time the media is played. The best time to make updates is right after it has been loaded. At this time, only video objects can be updated. The properties that can be changed are a subset of those available on the VideoDTO: FLVFullLengthURL, FLVFullSize, videoStillURL, adKeys, displayName, length, longDescription, shortDescription, thumbnailURL, renditions. Any changes to FLVFullLengthURL, videoStillURL, and thumbnailURL will include the URL's original parameters. For renditions, the existing Array will be overriden. The follow properties can be set on the objects in this Array: defaultURL, encodingRate, frameHeight, frameWidth, size
Parameters
media:Object — The media object to update.
|
MediaDTO — The updated MediaDTO object.
|
See also
// event handler used for a getMediaAsync() call private function onMediaLoad(event:ContentEvent):void { var media:Object = event.media; // Change the video URL to the new location. If this was a video with renditions, // the renditions property would be changed instead. media.FLVFullLengthURL = "http://myservername.com/mynewvideo.flv"; // assumes that the contentModule has been defined elsewhere and calls the API contentModule.updateMedia(media); }
mediaCollectionLoad | Event |
com.brightcove.api.events.ContentEvent
com.brightcove.api.events.ContentEvent.MEDIA_COLLECTION_LOAD
Dispatched when media is loaded through a call to getMediaCollectionAsynch(). Download code examples for this event from the article, Dynamically Loading Media into Players for ActionScript and JavaScript.
The ContentEvent.MEDIA_COLLECTION_LOAD constant defines the value of thetype
property of the event object for a
mediaCollectionLoad
event.
mediaLoad | Event |
com.brightcove.api.events.ContentEvent
com.brightcove.api.events.ContentEvent.MEDIA_LOAD
Dispatched when media is loaded through a call to getMediaAsynch().
The ContentEvent.MEDIA_LOAD constant defines the value of thetype
property of the event object for a
mediaLoad
event.
AUDIO_TRACK_PLAYLIST | Constant |
public static const AUDIO_TRACK_PLAYLIST:String = audioTrackPlaylist
Value that filters the type returned by the getAllMediaCollections()
or
getAllMediaCollectionIDs
method to only include audio track playlists
when passed as the collectionType
property.
ID | Constant |
public static const ID:String = id
Value that retrieves media or media collections by ID when passed as the property
parameter of the getMedia()
, getMediaAsync()
,
getMediaCollection()
or getMediaCollectionAsync()
method.
PLAYLIST | Constant |
public static const PLAYLIST:String = playlist
Value that filters the type returned by the getAllMediaCollections()
or
getAllMediaCollectionIDs
method to only include video playlists
when passed as the collectionType
property.
REFERENCE_ID | Constant |
public static const REFERENCE_ID:String = referenceId
Value that retrieves media or media collections by referenceID when passed as the property
parameter of the getMedia()
, getMediaAsync()
,
getMediaCollection()
or getMediaCollectionAsync()
method.