vlc.MediaList

class vlc.MediaList

Bases: _Ctype

Usage:

MediaList(list_of_MRLs)

See Instance.media_list_new() documentation for details.

add_media(mrl)

Add Media instance to media list.

Note

The lock should be held upon entering this function.

Parameters:

mrl – A Media instance or a MRL.

Returns:

0 on success, -1 if the media list is read-only.

count()

Get count on media list items The lock() should be held upon entering this function.

Returns:

number of items in media list.

event_manager()

Get libvlc_event_manager from this media list instance. The p_event_manager is immutable, so you don’t have to hold the lock

Returns:

libvlc_event_manager.

get_instance()
index_of_item(p_md)

Find index position of List media instance in media list. Warning: the function will return the first matched position. The lock() should be held upon entering this function.

Parameters:

p_md – media instance.

Returns:

position of media instance or -1 if media not found.

insert_media(p_md, i_pos)

Insert media instance in media list on a position The lock() should be held upon entering this function.

Parameters:
  • p_md – a media instance.

  • i_pos – position in array where to insert.

Returns:

0 on success, -1 if the media list is read-only.

is_readonly()

This indicates if this media list is read-only from a user point of view

Returns:

1 on readonly, 0 on readwrite.

item_at_index(i_pos)

List media instance in media list at a position The lock() should be held upon entering this function.

Parameters:

i_pos – position in array where to insert.

Returns:

media instance at position i_pos, or None if not found. In case of success, media_retain() is called to increase the refcount. on the media.

lock()

Get lock on media list items

media()

Get media instance from this media list instance. This action will increase the refcount on the media instance. The lock() should NOT be held upon entering this function.

Returns:

media instance.

release()

Release media list created with new().

remove_index(i_pos)

Remove media instance from media list on a position The lock() should be held upon entering this function.

Parameters:

i_pos – position in array where to insert.

Returns:

0 on success, -1 if the list is read-only or the item was not found.

retain()

Retain reference to a media list

set_media(p_md)

Associate media instance with this media list instance. If another media instance was present it will be released. The lock() should NOT be held upon entering this function.

Parameters:

p_md – media instance to add.

unlock()

Release lock on media list items The lock() should be held upon entering this function.