Overview
To identify a video as a 360° video, the projection property needs to be set. You can either set this property using the Media Module in Studio, or you can do it programmatically as shown in this topic.
In this topic, you will perform the following tasks:
Get client credentials
To work with the Brightcove APIs, you will need client credentials for the account and API(s) you wish to use.
- Get your client credentials in Studio by following the directions in Managing API Authentication Credentials. In the steps below, we will be making Player Management API requests using Postman, so your credentials should have at least the following permissions:
-
CMS: Video Read/Write
You can add as many additional permissions as you like to get credentials that will be usable for a wider range of API requests. Also note that you get credentials that will work for multiple accounts if you like.
-
Retrieve video information
Once you have uploaded your video to Video Cloud Studio, you are ready to retrieve video information from the CMS API. For information about uploading videos, see the Uploading Videos Using the Upload Module document.
- Open the Postman app.
- Get a new access token for your Video Cloud account, and select the Use Token button.
- Make a GET request to the CMS API, using the Get Video by ID syntax. You will do this by entering the following URL into the Enter request URL field, substituting your account id for
{account_id}
and your video id for{video_id}
:https://cms.api.brightcove.com/v1/accounts/{{account_id}}/videos/{{video_id}}
- Leave the method as GET, and select Send:
- In the response body, you should see the projection property.
Set 360° video properties
To indicate that a video is a 360° video, the projection property should be set to equirectangular.
- Return to the Postman app. You may need to get a new access token.
- Select PATCH as the HTTP method, using the same URL syntax as in the previous section.
- Click the Headers button, and supply the key - value pair Content-Type - application/json. Simply begin typing in the input areas and you will be supplied with options from which you can choose the indicated values.
- Click the Body section just under the URL, then the raw radio button:
- For the raw data, enter the following JSON code for the body (the screenshot following the JSON shows how the request should appear):
{ "projection" : "equirectangular" }
- Click Send
- In the response body, you should now see that the value for the projection property has been set.
You are now ready to play your video as a 360° video.