Dynamic Ingest API Sample: Add Scheduled Videos (Legacy Ingest)
In this sample, you will learn how to schedule videos to become available at some future time, so that they aren't accidentally played before they should be.
Overview
When you add a new video to your account, you may not wish to release the video for viewing until some time in the future. The video is potentially playable, however, as soon as a playable rendition is created. In addition to someone publishing the video by mistake, it might show up in a smart playlist because it matches the search criteria that selects the videos for the list.
The best way to prevent accidental pre-mature release is to schedule the video for when you want it to become available at the time you ingest it. You can do this simply by including a schedule
object in the request body for the CMS API call that creates the video:
{
"name": "greatblueheron.mp4",
"schedule": {
"starts_at": "2017-03-10",
"ends_at": "2018-12-31"
}
}
The starts_at
and ends_at
values can be full ISO 8601 date-time stamps, or you can just include the date part, as shown here. Both fields are optional: omitting the starts_at
field means the video will be available immediately; omitting the ends_at
field means that the video will be available indefinitely.
Getting Credentials
Rate limiting
See Best Practices for information on rate limiting.
Add scheduled video app
Find all the code associated with this sample in this GitHub repository.See the Pen Dynamic Ingest API Sample: Add Scheduled Videos (Legacy Ingest) by Brightcove Learning Services (@rcrooks1969) on CodePen.
Using the CodePen
Proxy code
In order to build your own version the sample app on this page, you must create and host your own proxy. (The proxies used by Brightcove Learning Services only accept requests from Brightcove domains.) You can download two versions of our proxy code: