Class: MediaMetadata

  • MediaMetadata is a class used to describe common media information like title, artist, images, and more, within the Cast framework.

  • It can represent metadata for the entire media or for individual sections within a media file, like chapters or segments.

  • You can specify the type of metadata, poster image URL, section duration, start times, and queue item ID using its properties.

  • The metadataType property is required and determines the kind of media being described (e.g., movie, TV show, music track).

  • MediaMetadata objects are used as part of MediaInformation or to define sections in container metadata.

Constructor

MediaMetadata

new MediaMetadata(type)

Parameter

type

cast.framework.messages.MetadataType

Type of metadata.

Value must not be null.

Properties

metadataType

non-null cast.framework.messages.MetadataType

The type of metadata.

posterUrl

(string or undefined)

Optional image URL to be shown when video is loading.

queueItemId

(number or undefined)

The queue item that include this media section. This is only relevant if used in container sections, and if there are multiple media items for the container.

sectionDuration

(number or undefined)

The media section duration in seconds. This is only required if the metadata describes a section of the media file that has a different duration value.

sectionStartAbsoluteTime

(number or undefined)

Alternative way to provide the section start time for live media. Provides the start time in UNIX Epoch time (seconds since the Unix epoch).

sectionStartTimeInContainer

(number or undefined)

The media section start time offset within the container, in seconds. If not provided, the framework assumes that it's the same as the offset within the media.

sectionStartTimeInMedia

(number or undefined)

The media section start time within the media file, in seconds. This can be negative if a section started in previous file.