使い方 Brightcove Player TVE用
アカウント設定
使い方 Video Cloud TVEではいくつかのアカウント設定が必要です Brightcove サポート。 TVEを使いたい場合は、 Brightcove カスタマーサポート 詳細については。
必須フィールド
この統合では、アカウントに次のカスタムフィールドの1つ以上を作成することができます。 以下の名前は 内部 フィールドの名前 - 表示名に好きなものを使うことができます。
bcadobepassrequestorid
bcadobepasstitle
bcadobepassreferenceid
bcadobepassrating
bcadobepassratingscheme
次のセクションでは、これらのフィールドの使用方法(存在する場合)とそうでない場合に使用される値を表示します。
自動生成 resourceID
更に requestorID
フィールド
ユーザーが Playback API TVE対応のアカウントから、APIは bcadobepassrequestorid
次の規則に従って
- カスタムフィールド値が
bcadobepassrequestorid
動画に存在する場合、APIは動画レベルの値を返します。 - 値が設定されていない場合
bcadobepassrequestorid
APIでは、アカウント設定に格納されているリクエスタIDの値が返されます。
ユーザーが Playback API TVE対応のアカウントから、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に含まれる値は、以下の規則に基づいていなければならない。
RSS XMLフィールド | Video Cloud フィールド |
---|---|
channel |
|
item-title |
|
guid |
|
rating |
|
rating-scheme |
|
設定 player
次のコードは、 Brightcove Player 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"
class="video-js"
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>
認証なしの要求に対する応答
以下は、 Playback API TVE認証が提供されていない場合。 ご覧のとおり、ビデオソースは使用できませんが、他のビデオメタデータが存在するため、 player コンテンツのプレビューを表示します。
{
"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"
}