MediaItem
The MediaItem class represents a single media item in a playlist and includes metadata and state information about the media. Below is a detailed reference for each property and method available in the MediaItem class.
Constructors
MediaItem
Description: Initializes a new instance of the
MediaItemclass.Parameters:
UriType type: The type of URI.string uri: The URI of the media item.MediaMetadata metadata(optional): Metadata associated with the media item.
Usage:
MediaItem item = new MediaItem(UriType.RemoteURL, "http://example.com/media.mp3");
Properties
Index
Description: Gets or sets the index of the media item in the playlist.
Type:
intUsage:
int index = item.Index; item.Index = 1;
PlaylistIndex
Description: Gets or sets the index of the playlist to which this media item belongs.
Type:
intUsage:
MetadataState
Description: Gets or sets the state of the metadata retrieval process.
Type:
MetadataStateUsage:
DownloadDirectory
Description: Gets or sets the download directory for the media item.
Type:
stringUsage:
MetadataType
Description: Gets or sets the type of metadata retrieval.
Type:
MetadataTypeUsage:
Metadata
Description: Gets or sets the metadata of the media item.
Type:
MediaMetadataUsage:
Uri
Description: Gets the URI of the media item.
Type:
stringUsage:
UriType
Description: Gets the URI type of the media item.
Type:
UriTypeUsage:
Title
Description: Gets the title of the media item.
Type:
stringUsage:
Artist
Description: Gets the artist of the media item.
Type:
stringUsage:
Genre
Description: Gets the genre of the media item.
Type:
stringUsage:
ReleaseDate
Description: Gets the release date of the media item.
Type:
stringUsage:
AlbumTitle
Description: Gets the album title of the media item.
Type:
stringUsage:
AlbumArtist
Description: Gets the album artist of the media item.
Type:
stringUsage:
Artwork
Description: Gets the artwork of the media item.
Type:
ArtworkUsage:
SerializedMediaItem
Description: Gets or sets the serialized representation of the media item.
Type:
stringUsage:
Methods
RetrieveMetadata
Description: Retrieves the metadata for the media item.
Usage:
SetMetadata
Description: Sets the metadata for the media item.
Parameters:
MediaMetadata metadata: The metadata to set.
Usage:
MetadataWarning
Description: Logs a warning if metadata is not retrieved yet.
Usage:
Example Usage
Here's an example of how you might use the MediaItem class in your application:
Last updated