Using a Non-Brightcove Player
Introduction
The Brightcove web and mobile device players have a considerable amount of functionality built in, directly or through plugins, to work various aspects of your Video Cloud account:
- Retrieve video data and metadata
- Handle content protection through domain or geo restriction
- Send analytics data to the Brightcove data collector
If for some reason you need to play your Video Cloud videos, you will need to handle this functionality yourself. The sections below explain how to use Brightcove APIs to do this.
Getting a policy key
In order to get video and playlist data, or set content restrictions, you will need a policy key. In most cases, you can do this through Video Cloud Studio, or you can use the Policy API.
Simple policy keys
If all you need to do is retrieve videos and/or playlists by their IDs, you can simply get the policy key from a player.
If you want to be able to search for videos using the Playback API, you will need to create a search-enabled policy key. You can do that through the Policy API, or use the sample app we have embedded in the Quick Start: Policy API.
Policy keys with playback restrictions
Domain restriction and geo restriction for players are also implemented using policy keys. If you need either one or both, the easiest way to get a policy key is to set the desired restrictions on a new player in Studio, and then get the policy key from that player. If you prefer, you can also generate this policy key directly, using the Policy API.
Getting video data
Once you have a policy key, you can retrieve video data for your player using the Playback API. Data can be retrieved in three ways:
- Get a video by ID or reference_id
- Get a playlist by ID or reference_id
- Get videos by search
See the Quick Start: Playback API for sample JavaScript you can use to set up the API request.
The response data will include video sources
, which is an array of rendition data, including the URL. You will also get URLs for thumbnail and poster images, as well as metadata such as the video name
and description
.
How you load this data into your player will depend on the player's API.
Analytics
Since non-Brightcove Players will not automatically send data to the Data Collection API for the Brightcove Analytics system, it is your responsibility to implement that.
What you will need to do depends on the API for the player, especially the events that are broadcast for player actions. See the Data Collection API Sample for a model based on the VideoJS player for guidance on what events you should capture and how to submit the data to the API.
Other functionality
If you require other functionality such as advertising or DRM unlocking, you will also need to implement this for your player. Looking at the source code for the Brightcove Player plugins will provide some useful clues as to what you need to do.