Set 360-Degree Video Properties

In this topic, you will learn how to set 360° video properties using the CMS API. We will use the Postman interface to send our requests and view the responses from the API.

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.

  1. 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.

  1. Open the Postman app.
  2. Get a new access token for your Video Cloud account, and select the Use Token button.
    Access token
    Access token
  3. 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}}
  4. Leave the method as GET, and select Send:
    GET Request
    GET Request
  5. In the response body, you should see the projection property.
    GET Response
    GET Response

Set 360° video properties

To indicate that a video is a 360° video, the projection property should be set to equirectangular.

  1. Return to the Postman app. You may need to get a new access token.
  2. Select PATCH as the HTTP method, using the same URL syntax as in the previous section.
    PATCH request
    PATCH request
  3. 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.
    Add Header
    Add Header
  4. Click the Body section just under the URL, then the raw radio button:
    Request Body
    Request Body
  5. 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"
        }
    PATCH Body
    PATCH Body
  6. Click Send
  7. In the response body, you should now see that the value for the projection property has been set.
    PATCH response
    PATCH response

    You are now ready to play your video as a 360° video.