プラグインレジストリとは何ですか?
プラグインレジストリは、 Player Management API Brightcoveプラグインに関する情報の格納に専念します。 レジストリは、保存された各プラグインのすべてのバージョン、およびそれぞれに関連付けられたスクリプトとスタイルシートのリファレンスとして機能します。 Player 構成では、プラグインレジストリを利用して現在のプラグインバージョンを表示し、プラグインバージョンを指定することもできます。
Advantages
プラグインレジストリの利点 Brightcove Player ユーザーは3倍です:
- 使用しているプラグインのバージョンを正確に確認できます player、およびその特定のプラグインバージョンに関連付けられた特定のJavaScriptおよびCSSファイル。
- 互換性のある新しいバージョンがリリースされたときにプラグインが自動的に更新されるように設定できます player バージョン。
- 何らかの理由であなたが player 特定の player バージョン、プラグインはその特定のバージョンのままになります player ロックされたとき。 プラグインが互換性のないバージョンにアップグレードされることを心配する必要はありません player バージョン。
現在適格なプラグイン
次の表は、プラグインレジストリで動作する、Brightcoveが提供するプラグインを示しています。 の プラグインレジストリID で使用されます player と組み合わせた構成 Player Management API。 多数の例がこの文書で示されます。
プラグイン名 | プラグインレジストリID |
---|---|
Adobe Analytics Player | @ brightcove / videojs-bc-aa |
Chromecast Receiver | @ brightcove / videojs-chromecast-receiver |
カスタムエンドスクリーン | @ brightcove / videojs-custom-endscreen |
DRM | @ brightcove / videojs-drm |
Googleアナリティクス Player | @ brightcove / videojs-bc-ga |
IMA3広告 | @ brightcove / videojs-ima3 |
オーバーレイ | @ brightcove / videojs-overlay |
ピクチャーインピクチャー | @ brightcove / videojs-pip |
プレイリストUI | @ brightcove / videojs-bc-playlist-ui |
品質選択メニュー | @ brightcove / videojs-quality-menu |
Social | @ brightcove / videojs-social |
SSAI | @ brightcove / videojs-ssai |
ティーリウム Player プラグイン | @ brightcove / videojs-bc-tealium |
プラグインの使用を指定する
プラグインの使用を指定するには、 player 作成では、必要なプラグインのレジストリIDを指定するだけです。 バージョン番号を指定する必要があります。自動更新されるメジャーバージョン(たとえば、 2.x)またはマイナーバージョン(たとえば、 2.0.10)は自動更新されません。 バージョンの設定の詳細はこのドキュメントの後半に記載されています。 また、 options
もしあれば、プラグインのために。
curl \
--header "Content-Type: application/json" \
--user $EMAIL \
--request POST \
--data '{
"name": "Plugin Registry Test Player",
"configuration": {
"video_cloud": {
"video": "4093372393001"
},
"plugins": [
{
"registry_id": "@brightcove/videojs-custom-endscreen",
"version": "2.x",
"options": { "content": "<strong>Content</strong> for <em>custom</em> end screen" }
}
]
}
}' \
https://players.api.brightcove.com/v2/accounts/$ACCOUNT_ID/players
作成された情報 player によって返されます Player Management API。 あなたが使用することができます URL 戻り値は、 index.htmlを 〜へ config.json そのURLを参照して、公開された構成を確認します player.
{
"id": "rkGD9W22Ob",
"url": "http://players.brightcove.net/1507807800001/rkGD9W22Ob_default/index.html",
"embed_code": "<iframe src='//players.brightcove.net/1507807800001/rkGD9W22Ob_default/index.html' allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe>",
"embed_in_page": "http://players.brightcove.net/1507807800001/rkGD9W22Ob_default/in_page.embed",
"preview_url": "http://preview-players.brightcove.net/v2/accounts/1507807800001/players/rkGD9W22Ob/preview/embeds/default/master/index.html",
"preview_embed_code": "<iframe src='//preview-players.brightcove.net/v2/accounts/1507807800001/players/rkGD9W22Ob/preview/embeds/default/master/index.html' allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe>"
}
公開の構成で player プラグインに関する情報が表示されます。 プラグインの特定のバージョンが、JavaScriptファイルとCSSファイルの対応する値とともに表示されることに注意してください。
{
"account_id": "1507807800001",
"compatibility": true,
"embed_id": "default",
"player": {
"template": {
"name": "single-video-template",
"version": "6.7.0"
}
},
"player_id": "SyITgzdjb",
"player_name": "Plugin Registry Test Player",
"plugins": [{
"injected_version": "2.0.10",
"name": "customEndscreen",
"registry_id": "@brightcove/videojs-custom-endscreen",
"version": "2.x"
}],
"scripts": [
"//players.brightcove.net/videojs-custom-endscreen/2.0.10/videojs-custom-endscreen.min.js"
],
"stylesheets": [
"//players.brightcove.net/videojs-custom-endscreen/2.0.10/videojs-custom-endscreen.css"
],
"updated_at": "2017-09-26T17:39:10.080Z",
"video_cloud": {
"policy_key": "BCpkADawqM3hOj9I_wRb6jx7SLoklIm8eiW-MH1C0CO5xnf8ndABL7WJQOVdWIusPlnfKUD5EZvjHyJOQGeCFndODaM7CRz4h4GxUTLN3OmO7dTcLnxS3cYrXOZx4eaqaSbVFDx1yFTvWX7m",
"video": "4093372393001"
}
}
特定のメジャーバージョンを指定する
構成できます player 特定のプラグインの最新バージョンを使用するには 主要な と互換性のあるバージョン player あなたが使用しています。 これを行うと、プラグインのマイナーバージョンがリリースされると、プラグインは自動的に最新のマイナーバージョンに更新されます。
たとえば、あなたがしたい場合 player の最新の互換バージョンのカスタムエンドスクリーンプラグインを含める メジャーバージョン2 プラグインの次のものを使用します。
curl \
--header "Content-Type: application/json" \
--user $EMAIL \
--request POST \
--data '{
"name": "Plugin Registry Test Player",
"configuration": {
"video_cloud": {
"video": "4093372393001"
},
"plugins": [
{
"registry_id": "@brightcove/videojs-custom-endscreen",
"version": "2.x"
}
]
}
}' \
https://players.api.brightcove.com/v2/accounts/$ACCOUNT_ID/players
結果の構成は、次のようになります。
"plugins": [{
"injected_version": "2.0.10",
"name": "customEndscreen",
"registry_id": "@brightcove/videojs-custom-endscreen",
"version": "2.x"
}],
"scripts": [
"//players.brightcove.net/videojs-custom-endscreen/2.0.10/videojs-custom-endscreen.min.js"
],
"stylesheets": [
"//players.brightcove.net/videojs-custom-endscreen/2.0.10/videojs-custom-endscreen.css"
],
特定のバージョンを指定する
使用するプラグインの特定のバージョンを指定できます。 これを行うと、プラグインはどのような状況でも自動的に更新されないので、必要に応じて手動で更新する必要があります。
プラグインのバージョンをロックするには、作成時にバージョンを指定するだけです player:
curl \
--header "Content-Type: application/json" \
--user $EMAIL \
--request POST \
--data '{
"name": "Plugin Registry Test Player",
"configuration": {
"video_cloud": {
"video": "4093372393001"
},
"plugins": [
{
"registry_id": "@brightcove/videojs-overlay",
"version": "1.0.2"
}
]
}
}' \
https://players.api.brightcove.com/v2/accounts/$ACCOUNT_ID/players
player 構成には、特定のバージョン、およびJavaScriptファイルとCSSファイルが反映されます。
"plugins": [{
"name": "overlay",
"registry_id": "@brightcove/videojs-overlay",
"version": "1.0.2"
}],
"scripts": [
"//players.brightcove.net/videojs-overlay/1.0.2/videojs-overlay.min.js"
],
"stylesheets": [
"//players.brightcove.net/videojs-overlay/1.0.2/videojs-overlay.css"
],
互換性のない割り当て
互換性のないプラグインを player、またはのバージョンを変更する player そのため、以前に割り当てられたプラグインは互換性がなくなり、エラーが発生します。 エラーの詳細はここにあります。
プラグインを非互換に割り当てます player
いつでも、 player 作成または更新、あなたはと互換性のないプラグインのバージョンを指定しようとしました player バージョンでは、エラーが発生します。 たとえば、互換性のない古いプラグインを新しいプラグインに割り当てようとしたときのAPIからの応答は次のとおりです player:
{
"message": "There are no versions of the plugin that match the specified major version. The major version specified was 1.x for plugin @brightcove/videojs-bc-playlist-ui",
"error_code": "PLAYER_MANAGEMENT_ERROR",
}
変化する player プラグインと互換性がないバージョン
既存のバージョンを変更しようとした場合 player、 そしてその player 新しく割り当てられたバージョンと互換性のないプラグインがすでにあります player、次のようなエラーが発生します。
{
"error_code":"APPLICATION_ERROR",
"message":"plugin \"@brightcove/videojs-ima3\" is not compatible with template 5.28.1"
}
Studioで設定されたプラグイン
プラグインがStudio経由でロードされている場合、プラグインはプラグインレジストリに新しい機能を反映します:
{
"account_id": "1507807800001",
"compatibility": true,
"embed_id": "default",
"player": {
"template": {
"name": "single-video-template",
"version": "6.7.0"
}
},
"player_id": "SJajDfuiW",
"player_name": "Plugin Registry Studio Configuration",
"plugins": [{
"injected_version": "2.0.10",
"name": "customEndscreen",
"options": {
"content": "<h3>This is the endscreen content</h3>"
},
"registry_id": "@brightcove/videojs-custom-endscreen",
"version": "2.x"
}],
"scripts": [
"//players.brightcove.net/videojs-custom-endscreen/2.0.10/videojs-custom-endscreen.min.js"
],
"stylesheets": [
"//players.brightcove.net/videojs-custom-endscreen/2.0.10/videojs-custom-endscreen.css"
],
"updated_at": "2017-09-26T18:09:31.940Z",
"video_cloud": {
"policy_key": "BCpkADawqM3YPJvvfxBgJNEGrPjTPoOw0LyCbiTPnDGtAVExTzXeAW3hcRtPpS8tNeSiA9MosLG076eMXWO8E2Lxv-V7mq1oTIgqK7Xf0HBP_TEm1i-e5zRN_VIW_SjFagYpRxuoM8btiEoD",
"video": null
}
}
あなたはで見ることができるように player 構成では、スタジオに読み込まれたプラグインは、メジャーバージョンの動作を使用して更新されます。つまり、マイナーバージョンの更新が自動的に適用されます。
レジストリ情報の更新
プラグインのレジストリ情報を更新できます player 標準手順を使用します。 たとえば、次のcurlステートメントはHTTPを使用します PATCH
プラグインを特定のバージョンからメジャーバージョンのアップデート動作に変更する方法:
curl \
--header "Content-Type: application/json" \
--user $EMAIL \
--request PATCH \
--data '{
"plugins": [{
"registry_id": "@brightcove/videojs-custom-endscreen",
"version": "2.x"
}]
}' \
https://players.api.brightcove.com/v2/accounts/$ACCOUNT_ID/players/$PLAYER_ID/configuration
覚えておいてください。 player 変更後。
プラグインレジストリAPI
2つの新しいエンドポイントが Player Management API レジストリからのプラグイン情報の取得を可能にします。このプラグイン情報は、次の機能を提供します。
- レジストリ内のすべてのプラグインを取得します。
- 特定のプラグインに関する情報を取得します。
すべてのプラグインを取得する
現在、レジストリにあるプラグインに関する情報を取得するには、次のコマンドを使用します。
curl \
--header "Content-Type: application/json" \
--user $EMAIL \
--request GET \
https://players.api.brightcove.com/v2/plugins
返される情報は、次のようになります。
[{
"documentation": "https://support.brightcove.com/configuring-adobe-analytics-event-tracking",
"description": "Adobe Analytics Player Plugin",
"id": "@brightcove/videojs-bc-aa",
"name": "bcAa",
"current_version": "1.x"
}, {
"documentation": "https://support.brightcove.com/configuring-google-analytics-event-tracking",
"description": "Google Analytics Player Plugin",
"id": "@brightcove/videojs-bc-ga",
"name": "bcGa",
"current_version": "1.x"
}, {
"documentation": "https://support.brightcove.com/google-tag-manager-plugin-brightcove-player",
"description": "Google Tag Manager Player Plugin",
"id": "@brightcove/videojs-bc-gtm",
"name": "bcGtm",
"current_version": "1.x"
}, {
"documentation": "https://support.brightcove.com/playlist-ui-plugin",
"description": "Brightcove customizations to videojs-playlist-ui",
"id": "@brightcove/videojs-bc-playlist-ui",
"name": "bcPlaylistUi",
"current_version": "3.x"
}, {
"documentation": "https://support.brightcove.com/tealium-plugin-brightcove-player",
"description": "Tealium Player Plugin",
"id": "@brightcove/videojs-bc-tealium",
"name": "bcTealium",
"current_version": "1.x"
}, {
"documentation": "https://support.brightcove.com/beta-chromecast-plugin-brightcove-player",
"description": "A Chromecast Receiver plugin for the Brightcove Player",
"id": "@brightcove/videojs-chromecast-receiver",
"name": "chromecastReceiver",
"current_version": "1.x"
}, {
"documentation": "https://support.brightcove.com/custom-endscreen-plugin",
"description": "Custom endscreens for video.js.",
"id": "@brightcove/videojs-custom-endscreen",
"name": "customEndscreen",
"current_version": "2.x"
}, {
"documentation": "https://support.brightcove.com/configuring-brightcove-player-drm",
"description": "Cross-browser support for MPEG-DASH w/ DRM using dash.js and silverlight and HLS Fairplay DRM",
"id": "@brightcove/videojs-drm",
"name": "eme",
"current_version": "5.x"
}, {
"documentation": "https://support.brightcove.com/advertising-ima3-plugin",
"description": "Google Interactive Media Ads (IMA) v3 support for video.js",
"id": "@brightcove/videojs-ima3",
"name": "ima3",
"current_version": "3.x"
}, {
"documentation": "https://support.brightcove.com/display-overlay-plugin",
"description": "Overlay for video.js.",
"id": "@brightcove/videojs-overlay",
"name": "overlay",
"current_version": "2.x"
}, {
"documentation": "https://support.brightcove.com/picture-picture-plugin-aka-floating-or-pinned",
"description": "A plugin for enabling a Picture-In-Picture mode for the Brightcove Player",
"id": "@brightcove/videojs-pip",
"name": "pip",
"current_version": "1.x"
}, {
"documentation": "https://support.brightcove.com/manual-rendition-selection-plugin",
"description": "Quality Selection Menu UI",
"id": "@brightcove/videojs-quality-menu",
"name": "qualityMenu",
"current_version": "1.x"
}, {
"documentation": "https://support.brightcove.com/social-media-plugin",
"description": "Social sharing integrations for video.js.",
"id": "@brightcove/videojs-social",
"name": "social",
"current_version": "3.x"
}, {
"documentation": "https://support.brightcove.com/advertising-ssai-plugin",
"description": "A plugin for the Brightcove Player implementing playback of SSAI streams.",
"id": "@brightcove/videojs-ssai",
"name": "ssai",
"current_version": "1.x"
}]
特定のプラグイン情報を取得する
特定のプラグインに関する情報を取得するには、次のコマンドを使用します。 プラグイン名はURLエンコードされている必要があります。 @brightcove/videojs-ima3
つかいます %40brightcove%2fvideojs-ima3
.
curl \
--header "Content-Type: application/json" \
--user $EMAIL \
--request GET \
https://players.api.brightcove.com/v2/plugins/%40brightcove%2fvideojs-ima3
返される情報は、次のようになります。
{
"versions": [{
"scripts": ["//players.brightcove.net/videojs-ima3/3/videojs.ima3.min.js"],
"stylesheets": ["//players.brightcove.net/videojs-ima3/3/videojs.ima3.min.css"],
"version_number": "3.x",
"minimum_template_version": "6.0.0"
}, {
"minimum_template_version": "5.0.0",
"version_number": "2.x",
"stylesheets": ["//players.brightcove.net/videojs-ima3/2/videojs.ima3.min.css"],
"scripts": ["//players.brightcove.net/videojs-ima3/2/videojs.ima3.min.js"]
}, {
"minimum_template_version": "1.14.0",
"version_number": "1.x",
"stylesheets": ["//players.brightcove.net/videojs-ima3/1/videojs.ima3.min.css"],
"scripts": ["//players.brightcove.net/videojs-ima3/1/videojs.ima3.min.js"]
}],
"documentation": "https://support.brightcove.com/advertising-ima3-plugin",
"description": "Google Interactive Media Ads (IMA) v3 support for video.js",
"id": "@brightcove/videojs-ima3",
"name": "ima3",
"current_version": "3.x"
}
このレスポンスには表示されていませんが、 before_template-version
プロパティと対応する値。 これは古いプラグインで表示され、最新のプラグインを設定します player そのプラグインバージョンと互換性のあるテンプレートバージョン。 の minimum_template_version
および before_template-version
連携して範囲を設定する player プラグインと互換性のあるテンプレートバージョン。