Skip to content

Playback API

The Playback API enables you to start the playback of a video.

Endpoint

POST /v2/watch/stream/{screener_key}/playback

Headers

Depending on the type of screener and the configuration settings, either a JWT token or an API key must be provided in the Authorization header. This allows you to ensure secure controlled access to Indee screeners, tailored to the specific requirements of your screener configurations.

JWT Token

If the product does not permit link-type screeners and the force-login option is enabled for the screener, a JWT token must be included in the Authorization header. This applies only to Publicity screeners and ensures that playback requests are securely authenticated.

Header Value
Authorization JWT token
API Key

If the product allows link-type screeners and force-login is not enabled, the API key can be used in the authorization header for authentication. This provides flexibility and ease of access for users while maintaining security.

Header Value
Authorization Bearer api_key

Request Body

    {
        "stream_protocol": "hls",
        "offline": true,
        "credentials": <credentials>
    }
Parameter Type Requirement Description
stream_protocol String Required The protocol used for streaming. Values accepted are: hls, dash.
offline Boolean Optional Allows viewing in offline mode. This is currently supported only for iPad and valid only if stream protocol is hls.
credentials Optional If the screener is password-protected, the password needs to be passed in the request to get the playback info. See below for more.

Credentials

If the screener is password-protected, the password needs to be passed in the request to get playback information as below:

    {
        "password": "abcd12345@"
    }

If the screener has 2FA protection where the viewer needs to verify with a phone number, the one-time passcode received as a text message needs to be passed in the request to get playback information. The schema would be as below:

    {
        "passcode": 123456
    }

Response

    {
        "session_key": "ssn-01j1f9m09mfy2a98jy5d8rftxx",
        "engagement": {
            "push_interval": 30
        },
        "drm": {
            "provider": "ezdrm",
            "ceritificate_url": "example.com",
            "license_url": "https://widevine-dash.ezdrm.com/proxy?pX=3B1xxD&sk=W4UHcGauhsZ610qdnFxxIhm-fezUvXWbOy9t041UxxE%3D&server_url=https://api.indee.tv/api/v1/videos/drm/widevine/",
            "token": 12345678,
        },
        "manifest": {
            "url": "example.com",
        },
        "custom_headers": {
            "headername1": "headervalue1",
            "headername2": "headervalue2"
        }
    }
Field Type Description
session_key String Unique identifier for the playback session being initiated.
engagement JSON Captures the engagement data for the video streaming.
push_interval Integer Seconds interval at which engagement data is pushed.
drm JSON object The encryption data associated with your DRM.
provider String Third party provider for DRM service. Values returned are ezdrm, vudrm or DRMTODAY.
ceritificate_url String This is returned only for hls playback.
license_url String URL of the DRM license.
token String Returned only when the provider is vudrm.
custom_headers JSON Custom headers to be passed along with all DRM license requests for playback. This varies depending on the provider.

DRM License Response Formatting

When the DRM provider is DRMTODAY, FairPlay responses are returned as Base64 encoded data and will need to be decoded for usage by the CDM for both the Browser and iOS.

Browser Example:

// Assume the raw license response is taken named rawLicenseBase64
let rawLicenseString = atob(rawLicenseBase64);
// Convert that string into a Uint8Array
let data = new Uint8Array(rawLicenseString.length);
for (let i = 0; i < rawLicenseString.length; ++i) {
    data[i] = rawLicenseString.charCodeAt(i);
}
let licenseData = data.buffer;
// Load licenseData into CDM however player framework utilizes this (usually in license interceptors)

iOS Example:

NSData *licenseData = [[NSData alloc] initWithBase64EncodedData:rawLicenseBase64 options:0];
// Load licenseData into CDM using this as a response to the
// getContentKeyAndLeaseExpiryfromKeyServerModuleWithRequest method for AVPlayer.