이 항목에서는 를 사용하여 비디오를 활성화, 비활성화 또는 예약하는 방법을 보여줍니다CMS API .
서문
나중에 비디오를 재생할 수 없도록 설정하려는 몇 가지 이유가 있습니다. 예:
- 아직 검토 중입니다.
- 아직 공개되지 않은 영화의 예고편입니다.
- 시작되지 않았거나 끝난 마케팅 캠페인의 일부입니다.
- 아직 공개되지 않은 뉴스 기사의 일부입니다.
아직 공개 페이지나 앱에 비디오 포함 코드를 넣지 않았다면 물론 볼 수 없지만 비디오가 실수로 게시될 수 있는 방법이 있습니다. 공개된 플레이리스트.
Video Cloud 비디오를 볼 수 없는지 확인하는 두 가지 방법이 있습니다.
이 두 가지 변경 사항은 Studio의 Media 모듈을 통해 구현할 수 있지만 여기서는 를 사용하여 이를 구현하는 방법을 설명하겠습니다CMS API . 이 두 작업은 모두 비디오 업데이트 요청을 사용하여 수행됩니다.
업데이트 비디오 요청
동영상을 업데이트하려면 다음 주소로PATCH
요청을 보내세요.
일반적으로 요청 본문에는 업데이트하려는 필드만 포함하면 되지만 현재 값과 함께 다른 필드도 포함할 수 있습니다. 다음 섹션에서 활성화/비활성화 및 예약에 대한 요청 본문을 살펴보겠습니다.
비디오 활성화/비활성화
비디오를 설정하면 비디오가 활성 (보기 가능) 또는 비활성 (볼 수 없음) 으로 설정됩니다state
. 기본적으로 동영상은ACTIVE
일단 인제스트됩니다 (동영상을 만들 때 생략했거나 업로드 모듈을 사용하여 업로드한 필수 필드가 없는 경우 제외).
비디오를 비활성화하려면 비디오 업데이트 요청과 함께 다음 요청 본문을 보내면 됩니다.
API 응답에서state
필드를 확인하여 동영상이 현재 비활성 상태인지 확인할 수 있습니다.
샘플 응답
{
"id": "1698990613556232930",
"account_id": "57838016001",
"ad_keys": null,
"clip_source_video_id": null,
"complete": true,
"created_at": "2021-05-06T06:48:31.963Z",
"created_by": {
"type": "unknown"
},
"cue_points": [
],
"custom_fields": {
},
"delivery_type": "dynamic_origin",
"description": "Updated at: 2021-05-07T22:37:46.492Z",
"digital_master_id": null,
"duration": 41259,
"economics": "AD_SUPPORTED",
"folder_id": null,
"geo": null,
"has_digital_master": true,
"images": {
"poster": {
"src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/1494916a-e8a7-45ac-882f-6e0aa3489846/main/1280x720/20s629ms/match/image.jpg",
"sources": [
{
"src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/1494916a-e8a7-45ac-882f-6e0aa3489846/main/1280x720/20s629ms/match/image.jpg",
"height": 720,
"width": 1280
}
]
},
"thumbnail": {
"src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/1494916a-e8a7-45ac-882f-6e0aa3489846/main/160x90/20s629ms/match/image.jpg",
"sources": [
{
"src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/1494916a-e8a7-45ac-882f-6e0aa3489846/main/160x90/20s629ms/match/image.jpg",
"height": 90,
"width": 160
}
]
}
},
"link": null,
"long_description": null,
"name": "Great Horned Owl",
"original_filename": "greathornedowl.mp4",
"projection": null,
"published_at": "2021-05-06T06:48:31.963Z",
"reference_id": "greathornedowl.mp4_1620283704192",
"schedule": null,
"sharing": null,
"state": "INACTIVE",
"tags": [
"bird",
"air",
"nature"
],
"text_tracks": [
],
"updated_at": "2021-05-16T22:54:09.168Z",
"updated_by": {
"type": "api_key",
"email": "rcrooks@brightcove.com"
},
"offline_enabled": false,
"playback_rights_id": "primary"
}
비디오를 다시 활성화하려면 요청 본문과 함께 다른 업데이트 비디오 요청을 보내십시오.
비디오 예약
동영상을 재생 가능 또는 재생 불가능하게 만드는 두 번째 방법은 동영상 업데이트 요청에서schedule
객체를 사용하는 것입니다. 그schedule object has two properties:
starts_at
비디오를 재생할 수 있게 되는 ISO-8601 날짜-시간 (필수)
ends_at
비디오를 더 이상 재생할 수 없는 ISO-8601 날짜-시간 (선택 사항)
다음은 2021년 5월 16일 오전 6시 (UTC) 에 동영상을 재생할 수 있게 하고 정확히 1년 후에 다시 재생할 수 없게 만드는 샘플 요청 본문입니다.
샘플 응답
{
"id": "1698990613556232930",
"account_id": "57838016001",
"ad_keys": null,
"clip_source_video_id": null,
"complete": true,
"created_at": "2021-05-06T06:48:31.963Z",
"created_by": {
"type": "unknown"
},
"cue_points": [
],
"custom_fields": {
},
"delivery_type": "dynamic_origin",
"description": "Updated at: 2021-05-07T22:37:46.492Z",
"digital_master_id": null,
"duration": 41259,
"economics": "AD_SUPPORTED",
"folder_id": null,
"geo": null,
"has_digital_master": true,
"images": {
"poster": {
"src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/1494916a-e8a7-45ac-882f-6e0aa3489846/main/1280x720/20s629ms/match/image.jpg",
"sources": [
{
"src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/1494916a-e8a7-45ac-882f-6e0aa3489846/main/1280x720/20s629ms/match/image.jpg",
"height": 720,
"width": 1280
}
]
},
"thumbnail": {
"src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/1494916a-e8a7-45ac-882f-6e0aa3489846/main/160x90/20s629ms/match/image.jpg",
"sources": [
{
"src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/1494916a-e8a7-45ac-882f-6e0aa3489846/main/160x90/20s629ms/match/image.jpg",
"height": 90,
"width": 160
}
]
}
},
"link": null,
"long_description": null,
"name": "Great Horned Owl",
"original_filename": "greathornedowl.mp4",
"projection": null,
"published_at": "2021-05-06T06:48:31.963Z",
"reference_id": "greathornedowl.mp4_1620283704192",
"schedule": {
"ends_at": "2022-05-16T06:00:00.000Z",
"starts_at": "2021-05-16T06:00:00.000Z"
},
"sharing": null,
"state": "ACTIVE",
"tags": [
"bird",
"air",
"nature"
],
"text_tracks": [
],
"updated_at": "2021-05-17T00:42:45.172Z",
"updated_by": {
"type": "api_key",
"email": "rcrooks@brightcove.com"
},
"offline_enabled": false,
"playback_rights_id": "primary"
}