Node - media

Purpose

The media node represents a single file or link stored in media services.

Type

media is a child block node of:

Example

1
2
{
  "type": "media",
  "attrs": {
    "type" : "file",
    "id": "6e7c7f2c-dd7a-499c-bceb-6f32bfbf30b5",
    "collection" : "my project files"
  }
}

Fields

NameRequiredTypeValue
typestring"media"
attrsobject
attrs.widthintegerA positive integer
attrs.heightintegerA positive integer
attrs.idstringMedia Services ID
attrs.typestring"file", "link"
attrs.collectionstringMedia Services Collection name
attrs.occurrenceKeystringNon—empty string

Attributes

  • width defines the display width of the media item in pixels. Must be provided within mediaSingle or the media isn't displayed.
  • height defines the display height of the media item in pixels. Must be provided within mediaSingle or the media isn't displayed.
  • id is the Media Services ID and is used for querying the media services API to retrieve metadata, such as, filename. Consumers of the document should always fetch fresh metadata using the Media API.
  • type whether the media is a file or a link.
  • collection the Media Services Collection name for the media.
  • occurrenceKey needs to be present in order to enable deletion of files from a collection.

Marks

The following marks can be applied:

Rate this page: