Skip to main content
Get Video Metadata
Updated over a week ago

Overview

The API facilitates retrieval of metadata pertaining to the presently played video within the AnyClip player.

Developers have the flexibility to obtain either the complete set of metadata associated with the current video or retrieve specific fields within it, as described below.

API

Get All Metadata

anyclip.widgets[0].getCurrentPlaylistItem()

This method returns an array containing video metadata objects.

A representative example of the response generated upon executing this method is provided below:

{
"sources": [
{
"src": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/hls_1700258828868/master.m3u8",
"files": [
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258828764_480x270_video.mp4?wid=Demo_Efi_2",
"width": 480,
"height": 270
},
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258829185_640x360_video.mp4?wid=Demo_Efi_2",
"width": 640,
"height": 360
},
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258829423_852x480_video.mp4?wid=Demo_Efi_2",
"width": 852,
"height": 480
},
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258829844_1280x720_video.mp4?wid=Demo_Efi_2",
"width": 1280,
"height": 720
},
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258830307_1920x1080_video.mp4?wid=Demo_Efi_2",
"width": 1920,
"height": 1080
}
],
"type": "application/x-mpegURL"
}
],
"altSources": [
{
"src": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258830307_1920x1080_video.mp4?wid=Demo_Efi_2",
"files": [
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258830307_1920x1080_video.mp4?wid=Demo_Efi_2",
"width": 1920,
"height": 1080
}
]
},
{
"src": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258829844_1280x720_video.mp4?wid=Demo_Efi_2",
"files": [
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258829844_1280x720_video.mp4?wid=Demo_Efi_2"
}
]
}
],
"brokenMedia": [],
"title": "How a 25-year-old CEO went from being homeless to launching a toy line at Walmart",
"image": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258896706_248x140_thumbnail.jpg?wid=Demo_Efi_2",
"hiResImage": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258896594_1280x720_thumbnail.jpg",
"images": [
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258897134_84x48_thumbnail.jpg?wid=Demo_Efi_2",
"width": 84,
"height": 48
},
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258896669_136x77_thumbnail.jpg?wid=Demo_Efi_2",
"width": 136,
"height": 77
},
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258896950_184x104_thumbnail.jpg?wid=Demo_Efi_2",
"width": 184,
"height": 104
},
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258896706_248x140_thumbnail.jpg?wid=Demo_Efi_2",
"width": 248,
"height": 140
},
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258896977_288x162_thumbnail.jpg?wid=Demo_Efi_2",
"width": 288,
"height": 162
},
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258896766_416x234_thumbnail.jpg?wid=Demo_Efi_2",
"width": 416,
"height": 234
},
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258897067_480x270_thumbnail.jpg?wid=Demo_Efi_2",
"width": 480,
"height": 270
},
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258896853_640x360_thumbnail.jpg?wid=Demo_Efi_2",
"width": 640,
"height": 360
},
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258897169_852x480_thumbnail.jpg?wid=Demo_Efi_2",
"width": 852,
"height": 480
},
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/1700258896594_1280x720_thumbnail.jpg?wid=Demo_Efi_2",
"width": 1280,
"height": 720
}
],
"ac_mediaid": "mz2ueurtgrzueslzk5fge4dgoe2gsq2j",
"mediaid": "mz2ueurtgrzueslzk5fge4dgoe2gsq2j",
"distributionKeywords": [
{
"category": "PEOPLE",
"keywords": [
{
"value": "Kendrick Lamar",
"uid": "AWifDrXHZEpPi9i_gCPp",
"thumbnailUrl": "https://cdn5.anyclip.com/people/k/kendricklamar-1550146955311.png",
"actions": {
"videos": {
"enabled": true,
"text": "Videos"
}
}
}
]
}
],
"cc": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/cc/EN/1700258787211_subtitles.vtt",
"ccFiles": [
{
"file": "https://cdn5.anyclip.com/fuBR34sBIyWJbpfq4iCI/cc/EN/1700258787211_subtitles.vtt",
"lang": "EN",
"langName": "English"
}
],
"performanceData": {
"view": 1490,
"like": 0,
"share": 0
},
"duration": 184267,
"created": 1700395200000,
"plot": "Netz is the CEO of Pudgy Penguins, an NFT collection existing on the Ethereum blockchain. Netz purchased the company less than a year later, and today Pudgy Penguins’ market cap stands at nearly $100 million.",
"lang": [
"EN"
],
"_clipOrigin": "traffic",
"playlistItemId_": 1
}


Get Specific field

Individual fields from the exemplified set can be retrieved independently by appending the corresponding field name to the aforementioned general function.

Here are few examples:

  • Video title:

anyclip.widgets[0].getCurrentPlaylistItem().title
  • Video ID

anyclip.widgets[0].getCurrentPlaylistItem().mediaid
  • Video Duration

anyclip.widgets[0].getCurrentPlaylistItem().duration
  • Keywords

anyclip.widgets[0].getCurrentPlaylistItem().distributionKeywords

Get Keywords In Watch

In order to receive the keywords of a Video that is currently playing on AnyClip's Watch interface, you would need to use to following function:

anyclip.widgets[0].getTMplaylist()[anyclip.widgets[0].playlistCurrentIndex()].keywords

Did this answer your question?