はじめに
Brightcove の Delivery Rules を使用すると、ジャスト・イン・タイムのマニフェスト生成機能を活用し、独自のルールに基づいてコンテンツの配信方法を制御できます。
Delivery Rules の詳細については、以下をご覧ください。
Brightcove Player の設定
Brightcove Player では、以下の方法で Delivery Rules を設定できます。
プレーヤー埋め込みコードを使用する
Video Cloud Studio の Media モジュールで動画を公開する際、Delivery Rules を追加できます。
標準埋め込みコード
標準埋め込みコード(iframe)の場合、deliveryConfigId クエリパラメータを使用します。
<iframe src="https://players.brightcove.net/.../index.html?deliveryConfigId=abcdef">
高度な埋め込みコード
高度な埋め込みコード(Videoタグ)の場合、data-delivery-config-id 属性を使用します。
<video-js data-delivery-config-id="abcdef">
JSON エディタを使用する
Players モジュール内で、プレーヤー設定を編集することで Delivery Rules を追加できます。
- Video Cloud Studio で Players モジュールに移動します。
- 左側のナビゲーションから JSON エディタ を選択します。
-
delivery_config_id属性を次のように追加します。
JSON エディタ
Catalog API を使用する
JavaScript を使用して、Catalog API で指定した deliveryConfigId を持つ Delivery Rule を取得できます。
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);
});
});
Player Management API を使用する
Player Management API でプレーヤーを設定する際、delivery_config_id プロパティを次のように設定できます。
{
"delivery_config_id": "abcdef",
...
}
詳細は Player Management API のドキュメントをご覧ください。