Ti.Brightcove Module

Description

The Ti.Brightcove module provides access to the retrieval and playback of videos from the Brightcove media service.

Getting Started

View the Using Titanium Modules document for instructions on getting started with using this module in your application.

Note that there may be two versions of this module available to you, one for use with pre-1.8.0.1 SDKs and one for use with 1.8.0.1 or newer. In your tiapp.xml file, make sure that you specify the version of the module that corresponds to the version of Titanium Mobile SDK that you are targeting. For Appcelerator modules, specify the 1.X version of the module if building for versions of Titanium Mobile SDK prior to 1.8.0.1 and specify the 2.X version of the module if building for versions of Titanium Mobile SDK 1.8.0.1 or newer.

Accessing the Ti.Brightcove Module

To access this module from JavaScript, you would do the following:

var Brightcove = require('Ti.Brightcove');

Functions

Ti.Brightcove.createVideoPlayer({...})

Creates and returns a Ti.Brightcove.VideoPlayer object.

Ti.Brightcove.getVideos([{...}])

Gets videos from the Brightcove service. Takes an optional dictionary argument, with the following (all optional) properties:

Returns the following dictionary:

Ti.Brightcove.getVideosByIds({...})

Gets videos with the specified IDs from the Brightcove service. Takes a dictionary argument, with the following properties:

Returns the following dictionary:

Ti.Brightcove.getRelatedVideos({...})

Gets videos related to a single video from the Brightcove service, which is done by combining description information from the provided video and matching it against other videos' description, tags, and name. Takes a dictionary argument, with the following properties:

Returns the following dictionary:

Ti.Brightcove.getVideosByReferenceIds({...})

Gets videos with the specified reference IDs from the Brightcove service. Takes a dictionary argument, with the following properties:

Returns the following dictionary:

Ti.Brightcove.getVideosByUserId({...})

Gets videos for the specified user ID from the Brightcove service. Takes a dictionary argument with the following properties:

Returns the following dictionary:

Ti.Brightcove.getModifiedVideos({...})

Gets videos from the Brightcove service that were modified after the specified time. Takes a dictionary argument, with the following properties:

Returns the following dictionary:

Ti.Brightcove.getVideosByText({...})

Gets videos from the Brightcove service whose name or description contains the provided text. Takes a dictionary argument, with the following properties:

Returns the following dictionary:

Ti.Brightcove.getVideosByTags({...})

Gets videos from the Brightcove service with the matching tags. Takes a dictionary argument, with the following properties:

Returns the following dictionary:

Ti.Brightcove.getPlaylists([{...}])

Gets playlists from the Brightcove service. Takes an optional dictionary argument, with the following (all optional) properties:

Returns the following dictionary:

Ti.Brightcove.getPlaylistsByIds({...})

Gets playlists with the specified IDs from the Brightcove service. Takes a dictionary argument, with the following properties:

Returns the following dictionary:

Ti.Brightcove.getPlaylistsByReferenceIds({...})

Gets playlists with the specified reference IDs from the Brightcove service. Takes a dictionary argument, with the following properties:

Returns the following dictionary:

Ti.Brightcove.getPlaylistsByPlayerId({...})

Gets playlists for the given player ID from the Brightcove service. Takes a dictionary argument, with the following properties:

Returns the following dictionary:

Properties

Ti.Brightcove.readToken

The read token string provided by Brightcove for access to the service. Must be set before calling any module functions.

Ti.Brightcove.deliveryType

The delivery type to use for the Brightcove service.

Ti.Brightcove.region

The region that Brightcove is operating in.

Ti.Brightcove.logging

Flag to turn internal Brightcove logging on and off. Useful for debugging.

Constants

Ti.Brightcove.SORT_BY_PUBLISH_DATE

A constant indicating that a returned list should be sorted by publication date.

Ti.Brightcove.SORT_BY_CREATION_DATE

A constant indicating that a returned list should be sorted by creation date.

Ti.Brightcove.SORT_BY_MODIFIED_DATE

A constant indicating that a returned list should be sorted by modification date.

Ti.Brightcove.SORT_BY_PLAYS_TOTAL

A constant indicating that a returned list should be sorted by the total number of plays.

Ti.Brightcove.SORT_BY_PLAYS_TRAILING_WEEK

A constant indicating that a returned list should be sorted by the total number of plays over the previous week.

Ti.Brightcove.ORDER_ASCENDING

A constant indicating that a returned list should be sorted in ascending order.

Ti.Brightcove.ORDER_DESCENDING

A constant indicating that a returned list should be sorted in descending order.

Ti.Brightcove.STATE_ACTIVE

Represents a video in the 'active' state.

Ti.Brightcove.STATE_INACTIVE

Represents a video in the 'inactive' state.

Ti.Brightcove.STATE_DELETED

Represents a video that has been deleted from the service.

Ti.Brightcove.PLAYLIST_OLDEST_TO_NEWEST

Represents a playlist type that is ordered oldest to newest.

Ti.Brightcove.PLAYLIST_NEWEST_TO_OLDEST

Represents a playlist type that is ordered newest to oldest.

Ti.Brightcove.PLAYLIST_ALPHABETICAL

Represents a playlist type that is ordered alphabetically.

Ti.Brightcove.PLAYLIST_PLAYS_TOTAL

Represents a playlist type that is ordered by the total number of plays.

Ti.Brightcove.PLAYLIST_PLAYS_TRAILING_WEEK

Represents a playlist type that is ordered by the number of plays in the previous week.

Ti.Brightcove.PLAYLIST_EXPLICIT

Represents a playlist with explicit, creator-defined ordering.

Ti.Brightcove.PLAYLIST_START_OLDEST_TO_NEWEST

Represents a playlist ordered by scheduled start times, oldest to newest.

Ti.Brightcove.PLAYLIST_START_NEWEST_TO_OLDEST

Represents a playlist ordered by scheduled start times, newest to oldest.

Ti.Brightcove.REGION_US

Sets the brightcove module to use the US region.

Ti.Brightcove.REGION_JP

Sets the brightcove module to use the Japan region.

Ti.Brightcove.DELIVERY_DEFAULT

Sets the brightcove module to use the default delivery type. Note that this is generally not suitable for streaming.

Ti.Brightcove.DELIVERY_HTTP

Sets the brightcove module to use HTTP delivery. This is the delivery value that should generally be used for streaming.

Usage

See example.

Author

Dawson Toth

Module History

View the change log for this module.

Feedback and Support

Please direct all questions, feedback, and concerns to info@appcelerator.com.

License

Copyright(c) 2010-2011 by Appcelerator, Inc. All Rights Reserved. Please see the LICENSE file included in the distribution for further details.