TVE에 브라이트코브 플레이어 사용하기
계정 구성
TVE와 함께 Video Cloud를 사용하려면 Brightcove 지원에서 일부 계정 구성이 필요합니다. TVE를 사용하려면 Brightcove 지원에 문의자세한 내용은.
필수 필드
이 통합을 위해 계정에서 다음 사용자 정의 필드 중 하나 이상을 생성 할 수 있습니다. 아래 이름은내부의필드 이름-표시 이름에 원하는대로 사용할 수 있습니다.
bcadobepassrequestoridbcadobepasstitlebcadobepassreferenceidbcadobepassratingbcadobepassratingscheme
다음 섹션에서는 이러한 필드가있는 경우 사용 방법과 그렇지 않은 경우 대신 사용되는 값을 볼 수 있습니다.
자동 생성resourceID과requestorID필드
사용자가 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에 포함 된 값은 다음 규칙을 기반으로해야합니다.
| RSS XML 필드 | 비디오 클라우드 필드 |
|---|---|
channel |
|
item-title |
|
guid |
|
rating |
|
rating-scheme |
|
플레이어 구성
다음 코드는 TVE 용 Brightcove Player를 구성하기위한 모델을 제공합니다.
<!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"
}