Asset Info

Retrieves information about the asset corresponding to the content being played.

Request

Request syntax: 

https://content.uplynk.com/player/assetinfo/Asset ID.json

Request syntax (playback session ID): 

https://content.uplynk.com/player/assetinfo/Asset ID.json?pbs=Playback Session ID

If available, you must specify a playback session ID.

Define the following variable(s) 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

Asset ID

Required

Replace this variable with the system-defined ID assigned to the asset being played.

Use the CMS or parse the playback URL to find this asset ID.
Learn more.

Ads

The asset ID for other content being played (e.g., server-side ads) is only discoverable via either of the following methods:

  • Preplay API: The response for this API includes the playback URL (playURL) and the playback session id (sid).

    Learn more.

  • SegmentMap Interface: Each of our SDKs includes an interface called SegmentMap that returns a list of segments in a playout. SegmentMap indicates where ad breaks are located, their asset IDs, and information required to render ad indicators and thumbnails.

Playback Session ID

Required

Replace this variable with the playback session ID.

Use the Preplay API to retrieve the playback session ID (sid).

If available, you must specify a playback session ID.

Response

The response for a successful request contains the following parameters:

Response Parameter

Type

Description

audio_only

Number

Returns 1 when the asset has been flagged as audio only. Valid values are:

0 | 1

boundary_details

Array

Indicates the offset and duration, in seconds, for each boundary in the asset.

error

Number

Returns 1 when an error occurred with the asset. Valid values are:

0 | 1

tv_rating

Number

Indicates the asset's TV rating. Valid values are:

  • -1: Not Available
  • 0: Not Rated
  • 1: TV-Y
  • 2: TV-Y7
  • 3: TV-G
  • 4: TV-PG
  • 5: TV-14
  • 6: TV-MA
  • 7: Not Rated

max_slice

Number

Indicates the total number of slices available for this asset.

thumb_prefix

String

Indicates the base URL for thumbnails.

slice_dur

Number

Indicates the average duration, in seconds, for each slice.

movie_rating

Number

Indicates the asset's movie rating. Valid values are:

  • -1: Not Available
  • 0: Not Applicable
  • 1: G
  • 2: PG
  • 3: PG-13
  • 4: R
  • 5: NC-17
  • 6: X
  • 7: Not Rated

owner

String

Indicates the user IDA user ID uniquely identifies a user account via an alpanumeric system-defined ID. for the asset's owner.

meta

Object

Returns the asset's metadata.

Add metadata to an asset via the CMS, Live Slicer API, or the Asset API.

rates

Array

Reports the asset's available bitrates as a collection of number values.

thumbs

Array

Contains an object for each available thumbnail resolution.

poster_url

String

Indicates the URL for the poster image.

Set an asset's poster image via the CMS or the Asset API.

duration

Number

Indicates the asset's duration in seconds.

default_poster_url

String

Indicates the permanent URL to the asset's default poster image.

desc

String

Indicates the asset's description.

rating_flags

Number

Indicates the set of rating flags assigned to the asset via a number derived from a bitwise operation on rating flags (DLSV). Sample values are provided below.

  • 0: No rating flags
  • 1: Coarse or crude language flag (L)
  • 2: Sexual situations flag (S)
  • 4: Violence flag (V)
  • 8: Suggestive dialog flag (D)
  • 15: All rating flags (DLSV)

external_id

String

Indicates the asset's external ID.

is_ad

Number

Returns 1 when the asset has been flagged as an ad. Valid values are:

0 | 1

asset

String

Indicates the asset's system-defined ID.

Sample Response

The following sample response contains information about the asset being played.

{
	"audio_only": 0,
	"boundary_details": [{
			"c3": {
				"duration": 73.1093,
				"offset": 362.024
			}
		}, {
			"c7": {
				"duration": 104.9706,
				"offset": 596.2079
			}
		}, {
			"halftime": {
				"duration": 1022.605,
				"offset": 996.232
			}
		}, {
			"c3": {
				"duration": 115.23,
				"offset": 2525.123
			}
		}, {
			"c7": {
				"duration": 135.1655,
				"offset": 3002.6599
			}
		}
	],
	"error": 0,
	"tv_rating": -1,
	"max_slice": 148,
	"thumb_prefix": "http://stg-ec-ore-u.uplynk.com/slices/...http://stg-ec-ore-u.uplynk.com/slices/062/e2cb36cb397f47a18371e18f40ec01b7/062048d702734ca6a38f3e7f8e4f4488/",
	"slice_dur": 4.010666666666666,
	"movie_rating": -1,
	"owner": "e2cb36cb397f47a18371e18f40ec01b7",
	"meta": {},
	"rates": [55, 105, 198, 348, 580, 995, 2055],
	"thumbs": [{
			"width": 128,
			"prefix": "",
			"bw": 128,
			"bh": 128,
			"height": 72
		}, {
			"width": 256,
			"prefix": "upl256",
			"bw": 256,
			"bh": 256,
			"height": 144
		}
	],
	"poster_url": "http://stg-cf-ore.uplynk.com/slices/...http://stg-cf-ore.uplynk.com/slices/062/e2cb36cb397f47a18371e18f40ec01b7/062048d702734ca6a38f3e7f8e4f4488/00000014.jpg",
	"duration": 596.4800000000015,
	"default_poster_url": "http://stg-ec-ore-u.uplynk.com/slices/...http://stg-ec-ore-u.uplynk.com/slices/062/e2cb36cb397f47a18371e18f40ec01b7/062048d702734ca6a38f3e7f8e4f4488/00000014.jpg",
	"desc": "Big Buck Bunny",
	"rating_flags": 0,
	"external_id": "",
	"is_ad": 0,
	"asset": "062048d702734ca6a38f3e7f8e4f4488"
}		

Thumbnails

Key information:

Generating a Thumbnail URL

This example demonstrates how to generate a thumbnail 60 seconds into the asset using the above sample response.

Step 1 - Slice Duration

The first step is to figure out the duration of each slice by examining the slice_dur parameter.

	"slice_dur": 4.010666666666666,

Based off of the slice_dur parameter, we know that thumbnails will be generated approximately every 4.01 seconds.

Additionally, we know that the first thumbnail (00000000.jpg) will always be generated at 0 seconds. This means that the second slice and the second set of thumbnails will be generated at approximately 4.01 seconds.

Step 2 - Slice Number

The next step is to figure out the slice that corresponds to the 60 second mark by using the following formula:

var sliceNum : Number = Math.ceil( playerTime / assetInfo.slice_dur);
// using the response data above.
// sliceNum = 15

As shown above, the 15th slice corresponds to the 60 second mark.

Step 3 - Available Slices

The next step is to verify that this value does not exceed the total number of slices available for this asset by comparing it to the max_slice parameter.

	"max_slice": 148,

Step 4 - Construct File Name

Since sliceNum is less than max_slice, we can proceed to convert sliceNum (i.e., 15) to a hex string (i.e., F) and then use this hex value to construct the thumbnail's base file name (0000000F.jpg).

Step 5 - Construct Thumbnail URL

Use the following syntax to construct the thumbnail URL:

thumb_prefix/Resolution-Specific PrefixBase File Name

Find the base URL for all thumbnails via the thumb_prefix parameter.

	"thumb_prefix": "http://stg-ec-ore-u.uplynk.com/slices/...http://stg-ec-ore-u.uplynk.com/slices/062/e2cb36cb397f47a18371e18f40ec01b7/062048d702734ca6a38f3e7f8e4f4488/",

Find the prefix for the desired resolution by examining the thumbs array.

	"thumbs": [{
			"width": 128,
			"prefix": "",
			"bw": 128,
			"bh": 128,
			"height": 72
		}, {
			"width": 256,
			"prefix": "upl256",
			"bw": 256,
			"bh": 256,
			"height": 144
		}
	],

For example, use the following URL to generate a 256x144 thumbnail:

http://stg-ec-ore-u.uplynk.com/slices/062/e2cb36cb397f47a18371e18f40ec01b7/062048d702734ca6a38f3e7f8e4f4488/upl2560000000F.jpg

Generating a Thumbnail URL with Server-Side Ads

Use either segment map data from our SDKs or the Preplay API to retrieve the playback session ID and index information.

A segment map contains a list of segment objects. Each object contains the following information:

Retrieve the following information via our SDKs:

To generate thumbnail URLs when server-side ads are present

  1. Use our SDK to retrieve segment map data.
  2. For each asset, call the AssetInfo API using the asset ID. Load and cache each response.
  3. Load thumbnails by:

    1. Looping through the segment map to find the location from which the thumbnail should be pulled.
    2. Adding the segment map's index value to sliceNum before converting the string to hex. This ensures that the proper offset is applied when there are multiple ads in the playout.

    Learn more about generating thumbnail URLs.

    Example

    Assuming both of the following conditions:

    • You want to load a thumbnail 60 seconds into playback.
    • The segment map indicates that there is a 30 second ad when playback starts.

    You should load the thumbnail at the 30 second mark.