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
libVLCLibVLC
MediaList(Media)
Get subitems of media descriptor object.
public MediaList(Media media)
Parameters
mediaMedia
MediaList(MediaDiscoverer)
Get media service discover media list.
public MediaList(MediaDiscoverer mediaDiscoverer)
Parameters
mediaDiscovererMediaDiscoverer
Properties
Count
Get count on media list items.
public int Count { get; }
Property Value
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
this[int]
Gets the element at the specified index
public Media? this[int position] { get; }
Parameters
positionintposition 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
mediaMediaa 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
mediaMediamedia 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
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
positionIndexintposition 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
mediaMediamedia instance to add
Events
EndReached
The media list reached its end
public event EventHandler<EventArgs> EndReached
Event Type
ItemAdded
An item has been added to the MediaList
public event EventHandler<MediaListItemAddedEventArgs> ItemAdded
Event Type
ItemDeleted
An item has been deleted from the MediaList
public event EventHandler<MediaListItemDeletedEventArgs> ItemDeleted
Event Type
WillAddItem
An item is about to be added to the MediaList
public event EventHandler<MediaListWillAddItemEventArgs> WillAddItem
Event Type
WillDeleteItem
An item is about to be deleted from the MediaList
public event EventHandler<MediaListWillDeleteItemEventArgs> WillDeleteItem