Brightcove Player Chromecast Receiver and Plugin v2.0.0

A new major version, v2.0.0, of the Brightcove Chromecast receiver and plugin are available.

This release sees the Chromecast receiver re-implemented using Google's CAF (Cast Application Framework) API.

Configure your Player

Requirements

Older versions or combinations may continue working, but they are not supported.

Using Studio

Configuring your player can be done in Studio by:

When configured in Studio, the Player Management API will automatically select the best version combination for your player's version. If you are getting v1.x of the Chromecast plugin, you need to update and republish your player!

Manual Configuration

In the JSON editor, add an object like this to the "plugins" array:

{
  "name": "chromecastReceiver",
  "options": {},
  "stylesheets": ["https://players.brightcove.net/videojs-chromecast-receiver/2/videojs-chromecast-receiver.css"],
  "scripts": ["https://players.brightcove.net/videojs-chromecast-receiver/2/videojs-chromecast-receiver.js"]
}

How it Works

When the Chromecast receiver plugin is added, the player will display a cast button in the player UI when there is an available Chromecast on the local network.

When this button is clicked or tapped, a cast session will be initiated with the current video that is loaded in the Brightcove Player. This involves:

  1. The plugin sends a set of parameters to the receiver.
  2. The receiver mirrors the sending player by loading it from Brightcove's CDN.
  3. Once loaded, the receiver-side player will load the video ID from the Playback API that was sent when the cast session began.
  4. Once loaded, the receiver-side player should begin playback at the playhead position of the sending player.

This process is identical for non-Video Cloud sources except there is no Playback API request.

Analytics Impact

Currently, from an analytics perspective, the cast session is treated as an entirely new playback session.

From a UX perspective, the viewer will see their stream pause on the sender device and resume on the receiver. From a data perspective, because our metrics are anonymized by default, it is as if a new viewer started a new stream on a separate device because that is, in actuality, what happened.

Plugin Options

The plugin supports the following options:

options.authRequest

Type: string or object or function
Default: {}

This is an uncommon option, you probably don't need it!

This is useful if you need the Chromecast to perform a request to get authorization to play content before a video is requested.

This can be used to get cookies, but your server will have to be set up to allow players.brightcove.net the ablity to have cross domain cookies set if you are hosting your own content.

String Usage

When authRequest is a string, an empty GET request will be made to that URL.

Object Usage

When authRequest is an object, it can be used to specify certain request payload properties:

Property Type Required? Default Description
authRequest.url string Yes undefined The URL to request.
authRequest.method string No 'GET' The HTTP method to use.
authRequest.body string No '' The request body.
authRequest.headers object No {} An object describing HTTP headers where the keys are the header name and the properties are the header values.
authRequest.withCredentials boolean No false Whether or not cross-site Access-Control requests should be made using credentials such as cookies, authorization headers, or TLS client certificates.
authRequest.timeout number No 15000 How many milliseconds to wait before giving up on the auth request.

Function Usage

When authRequest is a function, it should return either a string or an object as per those usages.

options.playerUrl

Type: string
Default: ''

By default, the sender-side player is mirrored on the receiver. You can use this option to provide a custom receiver-side Brightcove Player URL.

NOTE: This should be a URL to an index.min.js file on the Brightcove CDN.

Advice

If your web player(s) contain a large number of plugins or custom scripts, you should consider creating a lightweight player specifically for Chromecast playback.

The web player and its playback engine are already somewhat resource intensive, but in a resource constrained environment (such as a Chromecast) running even more heavy scripts can negatively impact the user experience!

options.splashScreen

Type: string
Default: ''

The splash screen that should be shown before a video and when videos are switching.

Limitations and Known Issues

Changes from v1.x to v2.x

Besides internal changes, like using the CAF API instead of the v2 Chromecast API, the following interfaces changed: