Create Virtual Linear Playlist

Creates a virtual linear playlist that contains one or more asset(s). Use a playlist to provide a virtual linear playback experience for assets.

Restrict a virtual linear playlist to assets that have been encoded with the same codec (i.e., AVC or HEVC).

Use the Bulk Smartstart endpoint to create a virtual linear experience for a single asset.

Request

Request syntax:

POST /linear-playlist

Request body parameters:

Pass the following request body parameters:

NameData TypeDescription
activeIntegerDetermines the playlist's status. Valid values are: 0: Inactive 1: Active Default value: 1
ad_slate_fillIntegerDetermines whether ad breaks with insufficient ads will be filled with ad slate. Valid values are: 0: Disables ad slate and returns back to content. 1: Enables ad slate. Default value: 0
beam_break_durationIntegerDetermines whether ad breaks defined within an asset are honored and their duration. Valid values are: 0: Ad breaks are ignored. #: Sets the duration, in seconds, for all ad breaks. Default value: 0
descStringSets the virtual linear playlist's description.
playlist RequiredListContains an ordered list of assets and ad breaks. A virtual linear playlist supports up to 100 assets.
repeatIntegerDetermines the number of times that the playlist will be repeated. Valid values are: 0: The playlist will not repeat. -1: The playlist will repeat indefinitely. * #: The playlist will repeat the specified number of times. Default value: 0
skip_drmIntegerDetermines whether playback of the virtual linear playlist requires a digital signature. Valid values are: 0: Playback requires a digital signature. 1: Playback is allowed without a digital signature. This property takes precedence over an asset's Require a token for playback setting. Default value: 0
studio_drm_requiredIntegerDetermines whether playback of the virtual linear playlist will be secured via Studio DRM. Valid values are: 0: Playback is not secured by Studio DRM. 1: Playback is secured via DRM. This property takes precedence over an asset's Require studio approved DRM for playback setting. Default value: 0

playlist List

The playlist list defines a virtual linear playlist via the following properties:

NameData TypeDescription
beam RequiredDictionaryContains an id property.
id RequiredStringbeam dictionary Indicates the system-defined ID for the asset that will be added to the virtual linear playlist.
adDictionaryContains a dur property.
durIntegerad dictionary Indicates the duration, in seconds, for an ad break that occurs immediately after the asset defined within the beam dictionary.

Response

The response for a successful request contains the following properties:

NameData TypeDescription
@idStringIndicates the relative path to this endpoint.
@typeStringReturns LinearPlaylist.
activeIntegerIndicates the playlist's status. Valid values are: 0: Inactive 1: Active
ad_slate_fillIntegerIndicates whether ad breaks with insufficient ads will be filled with ad slate. Valid values are: 0: Disables ad slate and returns back to content. 1: Enables ad slate.
beam_break_durationIntegerIndicates whether ad breaks defined within an asset are honored and their duration. Valid values are: 0: Ad breaks are ignored. #: Sets the duration, in seconds, for all ad breaks.
descStringIndicates the virtual linear playlist's description.
idStringIndicates the virtual linear playlist system-defined ID.
playlistListContains an ordered list of assets and ad breaks. A virtual linear playlist supports up to 100 assets.
profileStringReserved for future use.
repeatIntegerIndicates the number of times that the playlist will be repeated. Valid values are: 0: The playlist will not repeat. -1: The playlist will repeat indefinitely. * #: The playlist will repeat the specified number of times.
skip_drmIntegerDetermines whether playback of the virtual linear playlist requires a digital signature. Valid values are: 0: Playback requires a digital signature. 1: Playback is allowed without a digital signature. This property takes precedence over an asset's Require a token for playback setting.
studio_drm_requiredIntegerDetermines whether playback of the virtual linear playlist will be secured via Studio DRM. Valid values are: 0: Playback is not secured by Studio DRM. 1: Playback is secured via DRM. This property takes precedence over an asset's Require studio approved DRM for playback setting.

playlist List

The playlist list defines a virtual linear playlist via the following properties:

NameData TypeDescription
beamDictionaryContains an id property.
idStringbeam dictionary Indicates the system-defined ID for the asset that will be added to the virtual linear playlist.
adDictionaryContains a dur property.
durIntegerad dictionary Indicates the duration, in seconds, for an ad break that occurs immediately after the asset defined within the beam dictionary.

Sample Request/Response

Call the create_virtual_linear_playlist module (Python 3) to create a virtual linear playlist. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams

class Create_VLP:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        self._create_virtual_linear_playlist()

    def _create_virtual_linear_playlist(self):
        url = "{}{}".format(self.host, "/api/v4/linear-playlist")

        description = 'Sample Playlist' # Brief description of the playlist.
        repeat = -1 # Repeats the playlist indefinitely.
        beam_break_duration = 30 # Sets 30 second ad breaks.
        playlist = [{
                'beam':{
                    'id':'abc123456defghi789jklmno012345pq'  # Asset ID
                }
            }, {
                'ad':{
                    'dur': 20 # Sets 20 second ad breaks between assets.
                }
            }, {
                'beam':{
                    'id':'1df8d13992cd4222a7343b8fafd89cd7' # Asset ID
                }
            }
        ]

        payload = {
            'desc': description,
            'repeat': repeat,
            'beam_break_duration': beam_break_duration,
            'playlist': playlist
        }

        headers = {'Content-Type': 'application/json'}

        response = requests.post(
            url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
        )

        print(response.json())

Create_VLP().run()

Response:

{
	'@id': '/api/v4/linear-playlist/abce801613f94955b17db4f7c8e8137c',
	'@type': 'LinearPlaylist',
	'id': 'abce801613f94955b17db4f7c8e8137c',
	'desc': 'Sample Playlist',
	'repeat': -1,
	'profile': '',
	'beam_break_duration': 30,
	'ad_slate_fill': 0,
	'active': 1,
	'skip_drm': 0,
	'studio_drm_required': 0,
	'playlist': [{
			'beam': {
				'id': 'abc123456defghi789jklmno012345pq'
			}
		}, {
			'ad': {
				'dur': 20
			}
		}, {
			'beam': {
				'id': '1df8d13992cd4222a7343b8fafd89cd7'
			}
		}
	]
}