플러그인 레지스트리

이 항목에서는 플러그인 레지스트리를 사용하여 브라이트코브 플레이어에서 사용 중인 플러그인을 추적하고 관리하는 방법에 대해 알아봅니다.

플러그인 레지스트리란 무엇입니까?

플러그인 레지스트리는 브라이트코브 플러그인에 대한 정보를 저장하는 데 전념하는 플레이어 관리 API의 섹션입니다. 레지스트리는 각 저장된 플러그인의 모든 버전뿐만 아니라 각 플러그인과 관련된 스크립트 및 스타일시트에 대한 참조 역할을합니다. Player 구성은 플러그인 레지스트리를 활용하여 현재 플러그인 버전을 표시하고 플러그인 버전을 지정할 수도 있습니다.

장점

브라이트코브 플레이어 사용자를 위한 플러그인 레지스트리의 장점은 다음과 같은 세 가지입니다.

  • 플레이어에서 어떤 버전의 플러그인이 사용되고 있는지 확인할 수 있으며, 특정 플러그인 버전과 관련된 특정 JavaScript 및 CSS 파일을 확인할 수 있습니다.
  • 플레이어 버전과 호환되는 새 버전이 출시될 때 플러그인이 자동으로 업데이트되도록 구성할 수 있습니다.
  • 어떤 이유로 플레이어를 특정 플레이어 버전으로 유지하기로 선택한 경우, 플러그인은 잠겨 있을 때 해당 플레이어에 대해 동일한 특정 버전으로 유지됩니다. 플러그인이 플레이어 버전과 호환되지 않는 버전으로 업그레이드되는 것에 대해 걱정할 필요가 없습니다.

현재 적격한 플러그인

다음 표에는 플러그인 레지스트리와 함께 작동하는 브라이트코브가 제공한 플러그인이 나와 있습니다. 플러그인 레지스트리 ID는플레이어 관리 API와 함께 플레이어 구성과 함께 사용됩니다. 이 문서에는 수많은 예제가 나와 있습니다.

플러그인 이름 플러그인 레지스트리 ID
어도비 분석 플레이어 @brightcove /비디오 - 기원전 - AA
크롬캐스트 수신기 @brightcove /비디오 - 크롬캐스트-수신기
사용자 정의 끝화면 @brightcove /비디오 - 사용자 정의 최종 화면
DRM @brightcove /비디오 비디오
구글 애널리틱스 @brightcove /비디오 비디오 - 비씨-가
아이마3 광고 @brightcove /비디오즈 아이마3
오버레이 @brightcove /비디오 오버레이
픽처 인 픽처 @brightcove /비디오 - 핍
재생 목록 UI @brightcove /비디오 - BC-플레이리스트-UI
품질 선택 메뉴 @brightcove /비디오 - 품질 메뉴
소셜 @brightcove /비디오 소셜
싸이 @brightcove /비디오 - 싸이
Tealium 플레이어 플러그인 @brightcove /비디오즈 - BC-티알리움

플러그인 사용 지정

플러그인 사용을 지정하려면 플레이어 생성 시 원하는 플러그인의 레지스트리 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
          

생성된 플레이어에 대한 정보는 플레이어 관리 API에 의해 반환됩니다. 반환된URL값을 사용하고index.htmlconfig.json으로변경하고 해당 URL을 검색하여 게시 된 플레이어의 구성을 볼 수 있습니다.

    {
      "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 allow='encrypted-media'></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 allow='encrypted-media'></iframe>"
    }

게시 된 플레이어의 구성에서 플러그인에 대한 정보를 볼 수 있습니다. 플러그인의 특정 버전이 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": "BCpkADawqM3hOj9...FDx1yFTvWX7m",
        "video": "4093372393001"
      }
    }

특정 주 버전 지정

사용 중인 플레이어와 호환되는 특정메이저버전에 대해 최신 버전의 플러그인을 사용하도록 플레이어를 구성할 수 있습니다. 이렇게 하면 플러그인의 부 버전이 릴리스되면 플러그인이 자동으로 최신 부 버전으로 업데이트됩니다.

예를 들어, 플레이어가 플러그인의주요 버전 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"
    ],

특정 버전 지정

사용할 플러그인의 특정 버전을 지정할 수 있습니다. 이렇게하면 플러그인이 어떤 상황에서도 자동으로 업데이트되지 않으므로 필요한 경우 수동으로 업데이트해야합니다.

플러그인 버전을 잠그려면 플레이어를 만들 때 버전을 지정하기 만하면됩니다.

    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
          

플레이어 구성은 자바 스크립트 및 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"
    ],
          

호환되지 않는 할당

호환되지 않는 플러그인을 플레이어에 할당하거나 이전에 할당된 플러그인이 더 이상 호환되지 않도록 플레이어 버전을 변경하려고 하면 오류가 발생합니다. 오류는 여기에 자세히 설명되어 있습니다.

호환되지 않는 플레이어에 플러그인 할당

플레이어 생성 또는 업데이트에서 언제든지 플레이어 버전과 호환되지 않는 플러그인 버전을 지정하려고 하면 오류가 발생합니다. 예를 들어 호환되지 않는 이전 플러그인을 새 플레이어에 할당하려고 할 때 API의 응답은 다음과 같습니다.

    {
      "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",
    }
          

플러그인과 호환되지 않도록 플레이어 버전 변경

기존 플레이어의 버전을 변경하려고 할 때 플레이어에 새로 할당된 버전의 플레이어와 호환되지 않는 플러그인이 이미 있는 경우 다음과 유사한 오류가 발생합니다.

    {
      "error_code":"APPLICATION_ERROR",
      "message":"plugin \"@brightcove/videojs-ima3\" is not compatible with template 5.28.1"
    }
    

스튜디오 구성 플러그인

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": "BCpkADawqM3YPJ...SjFagYpRxuoM8btiEoD",
        "video": null
      }
    }
          

플레이어 구성에서 볼 수 있듯이 Studio에 로드된 플러그인은 주 버전 비헤이비어를 사용하여 업데이트됩니다. 즉 부 버전 업데이트가 자동으로 적용됩니다.

레지스트리 정보 업데이트

표준 절차를 사용하여 플레이어의 플러그인 레지스트리 정보를 업데이트할 수 있습니다. 예를 들어, 다음 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
          

변경 후 플레이어를 게시해야 합니다.

플러그인 레지스트리 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 속성과 해당 값을 볼 수도 있습니다. 이것은 이전 플러그인에 대해 나타나고 해당 플러그인 버전과 호환되는 최신 플레이어 템플릿 버전을 설정합니다. minimum_template_version 과 (와) 함께before_template-version 작동하여 플러그인이 호환되는 플레이어 템플릿 버전의 범위를 설정합니다.