支持 聯繫支持 | 系統狀況 系統狀態

插件註冊表

在本主題中,您將學習如何使用插件註冊表來跟踪和管理您的插件。 Brightcove Player 正在使用。

什麼是插件註冊表?

插件註冊表是 Player Management API 致力於存儲有關Brightcove插件的信息。 該註冊表可作為每個存儲插件的所有版本以及與每個插件關聯的腳本和样式表的參考。 Player 配置利用了插件註冊表,顯示了當前的插件版本,並且還允許您指定插件版本。

優點

插件註冊表的優點 Brightcove Player 用戶三折:

  • 您可以確切地看到您的插件正在使用哪個版本的插件 player,以及與該特定插件版本關聯的特定JavaScript和CSS文件。
  • 您可以將插件配置為在發布與您的兼容版本時自動更新 player 版本。
  • 如果出於某種原因您選擇保留 player 在特定的 player 版本,那麼您的插件將保持在相同的特定版本上 player 當它被鎖定時。 您不必擔心插件會升級到與您的版本不兼容的版本 player 版本。

當前合格的插件

下表顯示了Brightcove提供的可與插件註冊表一起使用的插件。 的 插件註冊表ID 將與 player 配置與 Player Management API。 本文檔中將顯示許多示例。

插件名稱 插件註冊表ID
Adobe分析 Player @ brightcove / videojs-bc-aa
Chromecast接收器 @ brightcove / videojs-chromecast-receiver
自定義端屏 @ brightcove / videojs-custom-endscreen
DRM @ brightcove / videojs-drm
Google Analytics(分析) Player @ brightcove / videojs-bc-ga
IMA3廣告 @ brightcove / videojs-ima3
覆蓋 @ brightcove / videojs-overlay
子母畫面 @ brightcove / videojs-pip
播放清單使用者介面 @ brightcove / videojs-bc-playlist-ui
質量選擇菜單 @ brightcove / videojs-quality-menu
Social @ brightcove / videojs-social
SSAI @ brightcove / videojs-ssai
Tealium 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。 您可以使用 網址 返回值,更改 的index.htmlconfig.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 配置中,將使用主要版本行為更新Studio中加載的插件,即,將自動應用次要版本更新。

更新註冊表信息

您可以更新插件註冊表信息 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

兩個新的端點已添加到 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 插件兼容的模板版本。


頁面最後更新於12年2020月XNUMX日