Using Delivery Rules with Brightcove Player

In this topic, you will learn how to configure Brightcove Player to use Brightcove's Delivery Rules.

Introduction

Brightcove's Delivery Rules allows you to leverage the just-in-time manifest generation capability to use custom rules to control how your content is delivered to the viewer.

For more details about Delivery Rules, see the following:

Configuring Brightcove Player

Delivery Rules can be configured in the Brightcove Player in the following ways:

Using the player embed code

When publishing a video in Video Cloud Studio's Media module, you can add delivery rules.

Standard embed code

With the standard embed code (iframe), use the deliveryConfigId query parameter:

<iframe src="https://players.brightcove.net/.../index.html?deliveryConfigId=abcdef">

Advanced embed code

With the advanced embed code (in-page embed), use the data-delivery-config-id attribute:

<video-js data-delivery-config-id="abcdef">

Using the JSON editor

To add delivery rules to a player, you can edit the player configuration in the Players module.

  1. In Video Cloud Studio, navigate to the Players module.
  2. In the left navigation, select JSON Editor.
  3. Add the delivery_config_id attribute as follows:

    JSON editor
    JSON editor

Using the Catalog API

Using Javascript, you can fetch the delivery rule by its deliveryConfigId using the Catalog API:

var player = videojs.getPlayer('myPlayerId');
player.ready(function () {
  var catalogParams = {
    deliveryConfigId: delivery_rules_id,
    type: 'video',
    id: video_id,
  };

  player.catalog.get(catalogParams, function (error, video) {
    if (error) {
      throw new Error(error);
    }

    player.catalog.load(video);
  });
});

Using the Player Management API

When configuring players with the Player Management API, you can set the delivery_config_id configuration property as follows:

{
"delivery_config_id": "abcdef",
...
}

For more details, see the Player Management API documents.