비디오 활성화/비활성화 또는 예약

이 항목에서는 를 사용하여 비디오를 활성화, 비활성화 또는 예약하는 방법을 보여줍니다CMS API .

서문

나중에 비디오를 재생할 수 없도록 설정하려는 몇 가지 이유가 있습니다. 예:

  • 아직 검토 중입니다.
  • 아직 공개되지 않은 영화의 예고편입니다.
  • 시작되지 않았거나 끝난 마케팅 캠페인의 일부입니다.
  • 아직 공개되지 않은 뉴스 기사의 일부입니다.

아직 공개 페이지나 앱에 비디오 포함 코드를 넣지 않았다면 물론 볼 수 없지만 비디오가 실수로 게시될 수 있는 방법이 있습니다. 공개된 플레이리스트.

Video Cloud 비디오를 볼 수 없는지 확인하는 두 가지 방법이 있습니다.

  • 비활성화
  • 나중에 재생할 수 있도록 예약

이 두 가지 변경 사항은 Studio의 Media 모듈을 통해 구현할 수 있지만 여기서는 를 사용하여 이를 구현하는 방법을 설명하겠습니다CMS API . 이 두 작업은 모두 비디오 업데이트 요청을 사용하여 수행됩니다.

인증

에 대한 요청에는 액세스 토큰이 포함된 인증 헤더가CMS API필요합니다. 클라이언트 자격 증명을 얻고 이를 사용하여 액세스 토큰을 검색하는 방법에 대한 자세한 내용은 Brightcove OAuth 개요를 참조하십시오 .

Studio 관리 페이지 또는 OAuth API를 사용하여 클라이언트 자격 증명을 생성할 수 있습니다.

또한 OAuth API를 직접 사용하여 액세스 토큰을 검색하거나 Postman 또는 Insomnia 앱을 사용하거나 요청을 하는 경우 액세스 토큰을 가져오도록 설정하는 방법에 대한 자습서를 참조하십시오.

업데이트 비디오 요청

동영상을 업데이트하려면 다음 주소로PATCH요청을 보내세요.

https://cms.api.brightcove.com/v1/accounts/account_id/videos/video_id

일반적으로 요청 본문에는 업데이트하려는 필드만 포함하면 되지만 현재 값과 함께 다른 필드도 포함할 수 있습니다. 다음 섹션에서 활성화/비활성화 및 예약에 대한 요청 본문을 살펴보겠습니다.

비디오 활성화/비활성화

비디오를 설정하면 비디오가 활성 (보기 가능) 또는 비활성 (볼 수 없음) 으로 설정됩니다state . 기본적으로 동영상은ACTIVE일단 인제스트됩니다 (동영상을 만들 때 생략했거나 업로드 모듈을 사용하여 업로드한 필수 필드가 없는 경우 제외).

비디오를 비활성화하려면 비디오 업데이트 요청과 함께 다음 요청 본문을 보내면 됩니다.

{
  "state": "INACTIVE"
}

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

비디오를 다시 활성화하려면 요청 본문과 함께 다른 업데이트 비디오 요청을 보내십시오.

{
  "state": "ACTIVE"
}

비디오 예약

동영상을 재생 가능 또는 재생 불가능하게 만드는 두 번째 방법은 동영상 업데이트 요청에서schedule객체를 사용하는 것입니다. 그schedule object has two properties:

  • starts_at비디오를 재생할 수 있게 되는 ISO-8601 날짜-시간 (필수)
  • ends_at비디오를 더 이상 재생할 수 없는 ISO-8601 날짜-시간 (선택 사항)

다음은 2021년 5월 16일 오전 6시 (UTC) 에 동영상을 재생할 수 있게 하고 정확히 1년 후에 다시 재생할 수 없게 만드는 샘플 요청 본문입니다.

{
  "schedule": {
		"starts_at": "2021-05-16T06:00:00.000Z",
		"ends_at": "2022-05-16T06:00:00.000Z"
	}
}
샘플 응답
{
  "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"
}