Update Virtual Linear Playlist

Updates a virtual linear playlist.

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

Modifications to a virtual linear playlist are only applicable for new playback sessions. Existing playback sessions will be unaffected by your changes.

Request

Request syntax:

PATCH /linear-playlist/Playlist ID

Define the following variable when submitting the above request:

VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3).Description
Playlist ID RequiredReplace this variable with the system-defined ID assigned to the desired virtual linear playlist. Use the Get All Virtual Linear Playlists endpoint to retrieve a list of virtual linear playlists and their system-defined IDs.

Request body parameters:

Pass the following request body parameters:

NameData TypeDescription
activeIntegerDetermines the playlist's status. Valid values are: 0: Inactive 1: Active
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.
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.
descStringSets the virtual linear playlist's description.
playlistListContains 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.
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.

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 update_virtual_linear_playlist module (Python 3) to create a virtual linear playlist. This module imports names from the api_auth module.

import json
import requests
from api_auth import APICredentials, APIParams

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

    def run(self):
        self._update_virtual_linear_playlist()

    def _update_virtual_linear_playlist(self):
        playlist_id = 'abce801613f94955b17db4f7c8e8137c' # Replace with the desired playlist ID.
        url = "{}{}{}".format(self.host, "/api/v4/linear-playlist/", playlist_id)

        beam_break_duration = 45 # Sets 45 second ad breaks.

        payload = {
            'beam_break_duration': beam_break_duration
        }

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

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

        print(response.json())

Update_VLP().run()

Response:

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