在 TVE 中使用布萊特灣玩家

本主題提供有關Video Cloud的信息Adobe Primetime電視無處不在(TVE)解決方案的集成。下面的說明通過消除不必要的值重複,並根據各個自定義字段自動生成Adobe Pass客戶端所需的XML請求值,從而簡化了視頻元數據的數據輸入和管理。

帳號配置

將Video Cloud與TVE一起使用需要Brightcove支持進行一些帳戶配置。如果您想使用TVE,聯繫Brightcove支持有關詳細信息。

必要欄位

對於此集成,您可能需要在帳戶中創建以下多個自定義字段之一。以下名稱是內部字段名稱-您可以使用任意顯示名稱。

  • bcadobepassrequestorid
  • bcadobepasstitle
  • bcadobepassreferenceid
  • bcadobepassrating
  • bcadobepassratingscheme

在下一節中,您將看到如何使用這些字段(如果存在),以及使用哪些值(如果沒有)。

自動生成resourceIDrequestorID領域

當用戶通過啟用了TVE的帳戶通過Playback API檢索視頻時,API將返回一個值bcadobepassrequestorid根據以下規則:

  • 如果是一個自定義字段值bcadobepassrequestorid視頻上存在該視頻,則API將返回視頻級值。
  • 如果沒有為bcadobepassrequestorid字段,API將返回存儲在帳戶設置中的請求者ID值。

 

當用戶通過啟用了TVE的帳戶通過Playback API檢索視頻時,API將返回一個值bcadobepassresourceid根據以下規則:

  • 如果是一個自定義字段值bcadobepassresourceid存在於視頻中,API將返回字段級值
  • 如果沒有為bcadobepassresourceid字段,API將根據下面指出的字段和XML格式返回計算值。

產生的bcadobepassresourceid字段應遵循Adobe指定的MRSS格式,並且幾乎在與Comcast的所有集成中都使用。

<rss version='2.0' xmlns:media='http://search.yahoo.com/mrss/'>
<channel>
<title>channel</title>
<item><title>item-title</title>
<guid>guid</guid>
<media:rating scheme='urn:rating-scheme'>rating</media:rating></item>
</channel>
</rss>

MRSS中包含的值應基於以下規則。

TVE RSS字段
RSS XML欄位 視訊雲端欄位
channel
  • 如果存在,請使用bcadobepassrequestorid
  • 如果不存在,請使用帳戶設置中設置的值
item-title
  • 如果存在,請使用bcadobepasstitle
  • 如果不存在,請使用name
guid
  • 如果存在,請使用bcadobepassreferenceid
  • 如果不存在,請使用reference_id
rating
  • 如果存在,請使用bcadobepassrequestorid
  • 只有在兩者都bcadobepassrating存在時才發送bcadobepassratingscheme
rating-scheme
  • 如果存在,請使用bcadobepassrating
  • 只有在兩者都bcadobepassrating存在時才發送bcadobepassratingscheme

配置播放器

以下代碼提供了用於配置Brightcove Player for TVE的模型。

<!doctype html>
<html>
<head>
  <title>TVE Example</title>
</head>
<body>
  <!-- Make sure your player doesn't have a video associated with it
  and don't use data-video-id to assign one. We'll request a video
  from the catalog by hand, detect that it's TVE content, trigger TVE
  authentication and then load the video into the player. -->
  <video-js id="tve-player"
    data-account="account1234"
    data-player="player-id"
    controls>
  </video-js>
  <script src="//players.brightcove.net/account1234/player-id_default/index.min.js"></script>
  <script>
  var player = videojs.getPlayer('tve-player');
  player.ready(function() {
    player.catalog.getVideo('ref:tve-video', function(error, video) {
      if (error) {
        // showErrorMessage() would be defined by you somewhere else
        // in the page
        return showErrorMessage(error);
      }
      // You can tell whether a video is TVE protected by checking to
      // see if the video sources contain URLs. If they don't, you need
      // to authenticate your viewer and re-request the video with their
      // TVE credentials.
      if (video.sources && video.sources[0].src) {
        // This is not a TVE video so it can be played back immediately
        return player.catalog.load(video);
      }
      // From here on, we're definitely dealing with a TVE video.
      // You need to provide an implementation for authenticateWithTVE()
      // to get a TVE token. See the documentation from your TVE provider
      // for details on how to do that.
      autenticateWithTVE(function(error, tveToken) {
        if (error) {
          return showErorMessage(error);
        }
        // Now that we have the token, we can re-request the video and get playable URLs.
        player.catalog.tveToken = tveToken;
        player.catalog.getVideo('ref:tve-video', function(error, video) {
          if (error) {
            return showErrorMessage(error);
          }
          player.catalog.load(video);
        });
      });
    });
  });
  </script>
</body>
</html>

未經身份驗證的請求響應

以下是未提供TVE身份驗證時Playback API的示例響應。如您將看到的,視頻源不可用,但是存在其他視頻元數據以允許播放器顯示內容的預覽。

{
  "sources": [

    ],
  "description": "The short description can be used to give more information about your video and will appear in many standard Brightcove Player templates.",
  "poster_sources": [
    {
      "src": "http://f1.media.brightcove.com/8/96980657001/96980657001_207574837001_commonRedpoll-still.jpg?pubId=3840518800001&videoId=3843070012001"
    },
    {
      "src": "https://f1.media.brightcove.com/8/96980657001/96980657001_207574837001_commonRedpoll-still.jpg?pubId=3840518800001&videoId=3843070012001"
    }
  ],
  "tags": [
    "sample"
  ],
  "cue_points": [

  ],
"errors": [
      {
        "error_subcode": "TVE_AUTH",
        "error_code": "SOURCES_RESTRICTED",
        "message": "Video sources are restricted by access policy.",
        "restricted_fields": [
          "sources"
        ]
      }
    ],
    "custom_fields": {
    "bcadobepassresourceid": "
    
    
        
        anotherRefId
        XXX
        ",
    "bcadobepassrequestorid": "asdfasf",
    "bcadobepassrating": "XXX",
    "bcadobepassreferenceid": "anotherRefId",
    "bcadobepasstitle": "PassTitle",
    "bcadobepassratingscheme": "TV-14"
  },
  "account_id": "3840518800001",
  "name": "Sample Video 2",
  "reference_id": null,
  "long_description": null,
  "duration": 29960,
  "economics": "AD_SUPPORTED",
  "published_at": "2014-10-16T16:35:24.520Z",
  "text_tracks": [

  ],
  "updated_at": "2017-05-26T01:48:41.396Z",
  "thumbnail": "http://f1.media.brightcove.com/8/96980657001/96980657001_180424037001_commonRedpoll-thumbnail.jpg?pubId=3840518800001&videoId=3843070012001",
  "poster": "http://f1.media.brightcove.com/8/96980657001/96980657001_207574837001_commonRedpoll-still.jpg?pubId=3840518800001&videoId=3843070012001",
  "offline_enabled": false,
  "link": null,
  "id": "3843070012001",
  "ad_keys": null,
  "thumbnail_sources": [
    {
      "src": "http://f1.media.brightcove.com/8/96980657001/96980657001_180424037001_commonRedpoll-thumbnail.jpg?pubId=3840518800001&videoId=3843070012001"
    },
    {
      "src": "https://f1.media.brightcove.com/8/96980657001/96980657001_180424037001_commonRedpoll-thumbnail.jpg?pubId=3840518800001&videoId=3843070012001"
    }
  ],
  "created_at": "2014-10-16T16:35:24.520Z"
}