Table of Contents

Class MediaList

Namespace
LibVLCSharp.Shared
Assembly
LibVLCSharp.dll

The MediaList holds a list of Media types

public class MediaList : Internal, IDisposable, IEnumerable<Media>, IEnumerable
Inheritance
MediaList
Implements
Inherited Members

Constructors

MediaList(LibVLC)

Create an empty media list.

public MediaList(LibVLC libVLC)

Parameters

libVLC LibVLC

MediaList(Media)

Get subitems of media descriptor object.

public MediaList(Media media)

Parameters

media Media

MediaList(MediaDiscoverer)

Get media service discover media list.

public MediaList(MediaDiscoverer mediaDiscoverer)

Parameters

mediaDiscoverer MediaDiscoverer

Properties

Count

Get count on media list items.

public int Count { get; }

Property Value

int

IsReadonly

This indicates if this media list is read-only from a user point of view. True if readonly, false otherwise

public bool IsReadonly { get; }

Property Value

bool

this[int]

Gets the element at the specified index

public Media? this[int position] { get; }

Parameters

position int

position in array where to insert

Property Value

Media

media instance at position, or null if not found. In case of success, Media.Retain() is called to increase the refcount on the media.

Methods

AddMedia(Media)

Add media instance to media list

public bool AddMedia(Media media)

Parameters

media Media

a media instance

Returns

bool

true on success, false if the media list is read-only

GetEnumerator()

Returns an enumerator that iterates through a collection of media

public IEnumerator<Media> GetEnumerator()

Returns

IEnumerator<Media>

an enumerator over a media collection

IndexOf(Media)

Find index position of List media instance in media list. Warning: the function will return the first matched position.

public int IndexOf(Media media)

Parameters

media Media

media instance

Returns

int

position of media instance or -1 if media not found

InsertMedia(Media, int)

Insert media instance in media list on a position.

public bool InsertMedia(Media media, int position)

Parameters

media Media

a media instance

position int

position in the array where to insert

Returns

bool

true on success, false if the media list is read-only

RemoveIndex(int)

Remove media instance from media list on a position.

public bool RemoveIndex(int positionIndex)

Parameters

positionIndex int

position in the array where to remove the iteam

Returns

bool

true on success, false if the media list is read-only or the item was not found

SetMedia(Media)

Associate media instance with this media list instance. If another media instance was present it will be released.

public void SetMedia(Media media)

Parameters

media Media

media instance to add

Events

EndReached

The media list reached its end

public event EventHandler<EventArgs> EndReached

Event Type

EventHandler<EventArgs>

ItemAdded

An item has been added to the MediaList

public event EventHandler<MediaListItemAddedEventArgs> ItemAdded

Event Type

EventHandler<MediaListItemAddedEventArgs>

ItemDeleted

An item has been deleted from the MediaList

public event EventHandler<MediaListItemDeletedEventArgs> ItemDeleted

Event Type

EventHandler<MediaListItemDeletedEventArgs>

WillAddItem

An item is about to be added to the MediaList

public event EventHandler<MediaListWillAddItemEventArgs> WillAddItem

Event Type

EventHandler<MediaListWillAddItemEventArgs>

WillDeleteItem

An item is about to be deleted from the MediaList

public event EventHandler<MediaListWillDeleteItemEventArgs> WillDeleteItem

Event Type

EventHandler<MediaListWillDeleteItemEventArgs>