Article ۰ Element ۰ Asset

Asset of an Element.

An asset configuration is dependant upon its use, it may alter depending on its type field.

Field nameTypeDescription
typeTypeType of the asset.
fieldsmap<string, string>Generic map containing general content and configuration information of the asset. Clients must be resilient to unknown or missing entry sets.
metadataMetadataOnly present for assets of TYPE.METADATA. Technical metadata for the parent element (state, validity, ...). See Metadata
referenceReferenceReference, 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 valueDescription
TYPE_UNSPECIFIEDunspecified
IMAGEimage asset with an resizable template URL and some image stats (width, height, cropping). See samples
VIDEOinternal video asset, expect (m3u8/HLS) URLS and some video stats (width, height, druation) within fields
EXTERNAL_VIDEOholds (m3u8/HLS) URLS to external videos, such as live streams and glomex
METADATAholds Metadata for the parent element and fields that also depend on the parent Element.Type
LINKadditional link (href, reference) asset for parent Element, e.g. an image with an optional link target.
AUDIOinternal 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"
  }
}
fielddescription
urlthe 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.
cropthis cropped image's loginal name, e.g. original, 16:9, custom
xx-offset off the original image for this crop
yy-offset off the original image for this crop
widththe width of this cropped image, before scaling.
heightthe height of this cropped image, before scaling

NOTES:

  • x + width <= width(original_image) otherwise the image generator will fail
  • y + 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"
  }
}
fielddescription
urlthe URL of this asset, usually a m3u8 playlist URL
mime_typethe mime type of this asset, usually a m3u8/HLS
duration_secondsvideo duration in seconds
heightthe height of the original video, may differ from the transcoded video.
widththe 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"
  }
}
fielddescription
media_idalpha-numeric CMS id of the media
captionthe video's caption
frame_capture:urlif frame capture was enabled during transcoding, this is the URL of the last frame capture
frame_capture:numeratorframe capture images are numerated, starting at 0000000 which can be used as the poster image.
frame_capture:denominatornumerator 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

...

[~]

[~]