Playlist
The Playlist
class represents a collection of media items, along with associated metadata such as the album title, album artist, and download directory. Below is a detailed reference for each property and method available in the Playlist
class.
Constructors
Playlist
Description: Initializes a new instance of the
Playlist
class.Parameters:
List<MediaItem> mediaItems
(optional): The list of media items in the playlist.string albumTitle
(optional): The title of the album.string albumArtist
(optional): The artist of the album.
Usage:
Properties
Index
Description: Gets or sets the index of the playlist.
Remarks: This is automatically set when the playlist is added to the
MediaPlayer
.Type:
int
Usage:
UriType
Description: Gets or sets the type of URI that the playlist contains.
Remarks: Once this information is passed to the native plugin, changes to this value will not be reflected.
Type:
UriType
Usage:
DownloadDirectory
Description: Gets or sets the directory where the media files will be downloaded to.
Remarks: Once this information is passed to the native plugin, changes to this value will not be reflected.
Type:
string
Usage:
AlbumTitle
Description: Gets or sets the title of the album.
Remarks: Once this information is passed to the native plugin, changes to this value will not be reflected.
Type:
string
Usage:
AlbumArtist
Description: Gets or sets the artist of the album.
Remarks: Once this information is passed to the native plugin, changes to this value will not be reflected.
Type:
string
Usage:
Count
Description: Gets the number of media items in the playlist.
Type:
int
Usage:
MediaItems
Description: Gets the list of media items in the playlist.
Type:
List<MediaItem>
Usage:
SerializedPlaylist
Description: Gets or sets the serialized representation of the playlist.
Type:
string
Usage:
Methods
AddEmptyMediaItem
Description: Adds an empty media item to the playlist.
Usage:
Contains
Description: Checks if the playlist contains a specific media item.
Parameters:
MediaItem mediaItem
: The media item to check.
Returns:
bool
Usage:
GetIndex
Description: Gets the index of a specific media item in the playlist.
Parameters:
MediaItem mediaItem
: The media item to find.
Returns:
int
Usage:
AddMediaItem
Description: Adds a media item to the playlist.
Parameters:
MediaItem item
: The media item to add.
Usage:
SetMediaItem
Description: Replaces a media item in the playlist at a specified index.
Parameters:
int index
: The index at which to replace the media item.MediaItem item
: The new media item.
Usage:
RemoveMediaItem
Description: Removes a media item from the playlist at a specified index.
Parameters:
int index
: The index of the media item to remove.
Usage:
SetMediaItems
Description: Replaces the current list of media items with a new list.
Parameters:
List<MediaItem> newMediaItems
: The new list of media items.
Usage:
ClearMediaItems
Description: Clears the list of media items.
Usage:
ReassureMediaItems
Description: Ensures that all media items in the playlist have the correct playlist index, media item index, and download directory.
Usage:
Example Usage
Here's an example of how you might use the Playlist
class in your application:
This API reference provides detailed information on each property and method available in the Playlist
class, along with their usage examples. This should help users understand and utilize the features of your media player effectively.
Last updated