Article ۰ Element ۰ Asset
Asset of an Element.
An asset configuration is dependant upon its use, it may alter depending
on its type
field.
Field name | Type | Description |
---|---|---|
type | Type | Type of the asset. |
fields | map<string, string> | Generic map containing general content and configuration information of the asset. Clients must be resilient to unknown or missing entry sets. |
metadata | Metadata | Only present for assets of TYPE.METADATA . Technical metadata for the parent element (state, validity, ...). See Metadata |
reference | Reference | Reference, e.g. URL belonging to this asset. |
message Asset {
Type type = 1;
map<string, string> fields = 2;
Metadata metadata = 3;
Reference reference = 4;
enum Type
Type of an asset.
Enum value | Description |
---|---|
TYPE_UNSPECIFIED | unspecified |
IMAGE | image asset with an resizable template URL and some image stats (width , height , cropping ). See samples |
VIDEO | internal video asset, expect (m3u8 /HLS ) URLS and some video stats (width , height , druation ) within fields |
EXTERNAL_VIDEO | holds (m3u8 /HLS ) URLS to external videos, such as live streams and glomex |
METADATA | holds Metadata for the parent element and fields that also depend on the parent Element.Type |
LINK | additional link (href, reference) asset for parent Element , e.g. an image with an optional link target. |
AUDIO | internal audio asset, expect (mp3 ) URLS |
enum Type {
TYPE_UNSPECIFIED = 0;
IMAGE = 1;
VIDEO = 2;
EXTERNAL_VIDEO = 3;
METADATA = 4;
LINK = 5;
AUDIO = 6;
}
Samples
Image Asset
{
"type": "IMAGE",
"fields": {
"crop": "16:9",
"url": "https://${CDN_URL}/89670804v20/0x37:1920x1079/fit-in/0x0/das-covid-19-dashboard-vom-robert-koch-institut-symbolbild-die-corona-inzidenz-in-muenchen-ist-deutlich-gesunken.jpg",
"width": "1920",
"x": "0",
"y": "37",
"height": "1079"
}
}
field | description |
---|---|
url | the URL for this cropped images withou scaling. If scaling is desired, replace the /0x0/ with the desired dimensions, /fit-in/ will make sure that the cropped image will fit inside this rectangle. |
crop | this cropped image's loginal name, e.g. original , 16:9 , custom |
x | x-offset off the original image for this crop |
y | y-offset off the original image for this crop |
width | the width of this cropped image, before scaling. |
height | the height of this cropped image, before scaling |
NOTES:
x + width <= width(original_image)
otherwise the image generator will faily + height <= height(original_image)
otherwise the image generator will fail
Video Asset
{
"type": "VIDEO"
"fields": {
"duration_seconds": "157.576",
"mime_type": "application/vnd.apple.mpegurl",
"url": "https://d1q9f0uk9ts7gc.cloudfront.net/2021/08/0DgeZjJtJ8EC/hls/maas-haben-500-menschen-aus-kabul-ausgeflogen.m3u8",
"height": "1080",
"width": "1920"
}
}
field | description |
---|---|
url | the URL of this asset, usually a m3u8 playlist URL |
mime_type | the mime type of this asset, usually a m3u8/HLS |
duration_seconds | video duration in seconds |
height | the height of the original video, may differ from the transcoded video. |
width | the width of the original video, may differ from the transcoded video. |
Video Metadata Asset
{
"type": "METADATA",
"fields": {
"media_id": "0DgeZjJtJ8EC",
"caption": "Eine Statue der Justitia mit einer Waage und einem Schwert in ihren Händen.",
"frame_capture:url": "https://example.com/thumbnails/thumb.0000031.jpg",
"frame_capture:numerator": "1",
"frame_capture:denominator": "5"
}
}
field | description |
---|---|
media_id | alpha-numeric CMS id of the media |
caption | the video's caption |
frame_capture:url | if frame capture was enabled during transcoding, this is the URL of the last frame capture |
frame_capture:numerator | frame capture images are numerated, starting at 0000000 which can be used as the poster image. |
frame_capture:denominator | numerator and denominator can be used to to calculate which frame capture image must be displayed at a given time. |
Example: for numerator=1
and denominator=5
, we have to increment the frame capture every 5 / 1 == 5 seconds
:
00:00.000 --> 00:05.000
/thumbnails/thumb.0000000.jpg
00:05.000 --> 00:10.000
/thumbnails/thumb.0000001.jpg
00:10.000 --> 00:15.000
/thumbnails/thumb.0000002.jpg
00:15.000 --> 00:20.000
/thumbnails/thumb.0000003.jpg
...