MediaMetadata Class

The metadata of a media (https://w3c.github.io/mediasession/#the-mediametadata-interface): its title, its artist, its album, its artwork and its chapters, shown by the media controls of the platform when it is the metadata of a MediaSession.

public sealed class MediaMetadata

Constructors

NameDescription
MediaMetadata(MediaMetadataInit?)Initializes a new instance of the MediaMetadata class (https://w3c.github.io/mediasession/#dom-mediametadata-mediametadata). The URLs of the images are parsed with the API base URL of the current global object.

MediaMetadata(MediaMetadataInit?)

MediaSession.cs

Initializes a new instance of the MediaMetadata class (https://w3c.github.io/mediasession/#dom-mediametadata-mediametadata). The URLs of the images are parsed with the API base URL of the current global object.

public MediaMetadata(MediaMetadataInit? init = null)

Parameters

init MediaMetadataInit?
The initial values.

Exceptions

TypeErrorException
The URL of an image is not valid.

See also

Properties

NameDescription
AlbumGets or sets the album of the media.
ArtistGets or sets the artist of the media.
ArtworkGets or sets the images of the artwork of the media, with absolute URLs: the URLs of the new images are parsed with the API base URL of the current global object (https://w3c.github.io/mediasession/#convert-artwork-algorithm). The pages get a frozen array of frozen objects.
ChapterInfoGets the chapters of the media.
TitleGets or sets the title of the media.

Gets or sets the album of the media.

public string Album { get; set; }

Gets or sets the artist of the media.

public string Artist { get; set; }

Gets or sets the images of the artwork of the media, with absolute URLs: the URLs of the new images are parsed with the API base URL of the current global object (https://w3c.github.io/mediasession/#convert-artwork-algorithm). The pages get a frozen array of frozen objects.

public IReadOnlyList<MediaImage> Artwork { get; set; }

ChapterInfo

MediaSession.cs

Gets or sets the title of the media.

public string Title { get; set; }