This is a simple example of how to use the Playlist API to get the data for a Video Cloud playlist and present it either as JSON or MRSS data that you could pass to a syndication partner.
For the security of your content, the URLs for videos and assets returned by Brightcove APIs are signed, meaning that they include a token that is only good for a short time - usually a few hours, but this can vary depending on the account configuration. This means that the URLs in the MRSS code generated by this tool will only be good for the period of time.
You can deal with this in one of two ways:
- You can ask Brightcove Support to increase the "time-to-live" for the tokens attached to media URLs for your account. The value can be set to any period up to one year. However, be aware that this is an account-level setting and the change will apply to all your videos.
- Alternatively, you can create your own version of this app, and have it create a fresh version of your MRSS feed on a regular basis, within the token life.
To build this yourself, you need two things:
- A Video Cloud playlist id, which you can obtain from Studio
- A policy key for your Video Cloud account, which you can obtain from any Brightcove Player in your account, or from the Policy API
The feed generator
Find all the code associated with this sample in this GitHub repository.