Chromecast plugin

The Chromecast plugin adds support for casting your videos to a Chromecast device.

Before you start

Before you use this plugin with the standalone player, we recommend the following steps:

  • Read about embedding the core player in your site by adding the minimum CSS and JavaScript player components.
  • Make sure you have a player token. For more, see Token configuration . Tokens aren't needed for local development.
  • The instructions on this page assume you're using the Wowza Flowplayer CDN to embed the player in your site.

Install the plugin

To create a custom player with Chromecast suport, include the plugin next to the core player:

Copy
Copied
<!-- Load standard player skin -->
<link rel="stylesheet" href="https://cdn.flowplayer.com/releases/native/3/stable/style/flowplayer.css">
<!-- Load player script -->
<script src="//cdn.flowplayer.com/releases/native/3/stable/flowplayer.min.js"></script>
<!-- Load Chromecast plugin -->
<script src="//cdn.flowplayer.com/releases/native/3/stable/plugins/chromecast.min.js"></script>
Info

You can only cast from HTTPS sites. Insecure websites don't display the cast icon.

Configure the plugin

The plugin can be set up at the top-level configuration under the chromecast namespace.

Property Description
app
string
The application ID the Chromecast receiver should use to display content. Default value is flowplayer.chromecast.apps.STABLE. For more, see Override the app property.
crossOrigin
boolean
Turns off anonymous crossorigin requests and instead, sends cookies. Default value is false.
hlsSegmentFormat
string
Defines the format for an HLS audio segment. Default value is ts. For more, see HlsSegmentFormat.
hlsVideoSegmentFormat
string
Defines the format for an HLS video segment. Default value is mpeg2_ts. For more, see HlsVideSegmentFormat.

Example

Copy
Copied
flowplayer("#player", {
  src: "example.flowplayer.com/fake.m3u8",
  token: "[your-player-token]",
  chromecast: {
    app: flowplayer.chromecast.apps.CANARY,
    hlsSegmentFormat: "ts",
    hlsVideoSegmentFormat: "mpeg2_ts"
  }
});

Override the app property

Wowza Flowplayer offers the two public applications listed in the following table.

Name Symbol location Description
stable flowplayer.chromecast.apps.STABLE The stable release for our Chromecast Receiver application.
canary flowplayer.chromecast.apps.CANARY the canary release for our Chromecast Receiver application. This is the latest beta release that's perfect for testing your code base against what we may soon release to production.

If you have your own CAF Receiver Application registered with Google, you can override the app property and application ID.

info

When integrating your own CAF Receiver Application, not all features may be available.