Native Media Player
Search Results for

    Show / Hide Table of Contents

    Class Playlist

    Inheritance
    object
    Playlist
    Namespace: Glitch9.NativeMediaPlayer
    Assembly: .dll
    Syntax
    [Serializable]
    public class Playlist

    Constructors

    | Edit this page View Source

    Playlist(List<MediaItem>, string)

    Declaration
    public Playlist(List<MediaItem> mediaItems = null, string name = null)
    Parameters
    Type Name Description
    List<MediaItem> mediaItems
    string name

    Properties

    | Edit this page View Source

    Count

    The number of MediaItem in the Playlist.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Index

    The index of this Playlist.

    Declaration
    public int Index { get; }
    Property Value
    Type Description
    int
    Remarks

    It's automatically set when the playlist is added to the MediaPlayer.

    | Edit this page View Source

    IsEmpty

    Declaration
    public bool IsEmpty { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    MediaItems

    The MediaItem in the Playlist.

    Declaration
    public List<MediaItem> MediaItems { get; }
    Property Value
    Type Description
    List<MediaItem>
    | Edit this page View Source

    Name

    The name of this Playlist.

    Declaration
    public string Name { get; set; }
    Property Value
    Type Description
    string

    Methods

    | Edit this page View Source

    Add(MediaItem)

    Adds a MediaItem to the Playlist.

    Declaration
    public void Add(MediaItem item)
    Parameters
    Type Name Description
    MediaItem item
    | Edit this page View Source

    Clear()

    Clears all MediaItems in the Playlist.

    Declaration
    public void Clear()
    | Edit this page View Source

    Contains(MediaItem)

    Checks if the Playlist contains a MediaItem.

    Declaration
    public bool Contains(MediaItem mediaItem)
    Parameters
    Type Name Description
    MediaItem mediaItem
    Returns
    Type Description
    bool
    | Edit this page View Source

    GetIndex(MediaItem)

    Gets the index of aMediaItem in the Playlist.

    Declaration
    public int GetIndex(MediaItem mediaItem)
    Parameters
    Type Name Description
    MediaItem mediaItem
    Returns
    Type Description
    int
    | Edit this page View Source

    GetIndex(string)

    Gets the index of a MediaItem in the Playlist by its media ID. This is useful when you have the media ID but not the actual MediaItem. If the media ID is not found, it returns -1.

    Declaration
    public int GetIndex(string mediaId)
    Parameters
    Type Name Description
    string mediaId
    Returns
    Type Description
    int
    | Edit this page View Source

    GetMediaItem(string)

    Gets a MediaItem from the Playlist by its media ID. This is useful when you have the media ID but not the actual MediaItem. If the media ID is not found, it returns null.

    Declaration
    public MediaItem GetMediaItem(string mediaId)
    Parameters
    Type Name Description
    string mediaId
    Returns
    Type Description
    MediaItem
    | Edit this page View Source

    Insert(int, MediaItem)

    Insert a MediaItem to the Playlist at a specific index without replacing any item.

    Declaration
    public void Insert(int index, MediaItem item)
    Parameters
    Type Name Description
    int index
    MediaItem item
    | Edit this page View Source

    Remove(MediaItem)

    Removes a MediaItem from the Playlist.

    Declaration
    public void Remove(MediaItem item)
    Parameters
    Type Name Description
    MediaItem item
    | Edit this page View Source

    RemoveAt(int)

    Removes the MediaItem at the specified index in the Playlist.

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    int index
    | Edit this page View Source

    Set(int, MediaItem)

    Replace a MediaItem in the Playlist.

    Declaration
    public void Set(int index, MediaItem item)
    Parameters
    Type Name Description
    int index
    MediaItem item
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX