[Python] Using playlists

This forum is about all development around libVLC.
Nepho
Blank Cone
Blank Cone
Posts: 16
Joined: 23 Mar 2015 01:50

[Python] Using playlists

Postby Nepho » 09 Apr 2015 11:39

Hi.

How do I handle playlists?
First of all, the insert_media() method will randomly cause an access violation, so this sucks.
But I can skip this part anyway by creating the playlist by hand. Anyway.
Now that I have my playlist, how the hell do I tell VLC to play it with a shuffle? There is absolutely nothing about this in the documentation. It's a basic feature, why can't I do it?
Next, how the hell do I get the title/filename of the currently played video? The only thing that comes close to it is the get_title() method of the MediaPlayer class (this method is not included in the MediaListPlayer class for some reason), and this get_title() doesn't even get me the title, it ""[returns] title number currently playing, or -1". In my case, it always returns 00, I don't really see what I can do with that.

Anyway, someone to help me? Or should I just switch to another media player?

Thanks.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: [Python] Using playlists

Postby Jean-Baptiste Kempf » 14 Apr 2015 21:36

MediaList are to be used for playlists.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Nepho
Blank Cone
Blank Cone
Posts: 16
Joined: 23 Mar 2015 01:50

Re: [Python] Using playlists

Postby Nepho » 14 Apr 2015 22:56

Hello Jean-Baptiste,

Thank you for your answer.

I have several problems with the MediaList class (and its associated MediaListPlayer).

Firstly, when I add Medias to a MediaList, it will sometimes raise an access violation exception.
I sent a ticket to the dev team about this, I hope it will get fixed soon. But I can get around this bug
by manually creating a playlist before using my script.

Secondly, I can't get any information about the media being played while using a MediaListPlayer.
As described in my first post, the only thing that could help me is only a method of the MediaPlayer class,
and it's called get_title(). Now, it's surprising, but get_title() doesn't return me a string with the file name,
but only an integer (which is always 0, in my case). So... I don't really understand how all of this must be used.

Some help would be greatly appreciated, since using the MediaListPlayer would fix most of my issues.

Thanks in advance.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: [Python] Using playlists

Postby Jean-Baptiste Kempf » 14 Apr 2015 23:08

I don't know enough the Python bindings for this.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Nepho
Blank Cone
Blank Cone
Posts: 16
Joined: 23 Mar 2015 01:50

Re: [Python] Using playlists

Postby Nepho » 15 Apr 2015 17:49

Alright, thanks for the help anyway.

Since nobody has been able to help me for now a whole month,
I'll just assume that that either the documentation is not complete,
or the Python bindings are just not fully working/complete.

Do you know any other media player that has a Python API I could use?

Thanks in advance!

OlivierAubert
Developer
Developer
Posts: 92
Joined: 08 Mar 2007 15:43

Re: [Python] Using playlists

Postby OlivierAubert » 11 May 2015 23:55

Regarding your question about getting the currently playing item, the libvlc API (from libvlc_media_list_player.h) does not provide such a function. Hence the python bindings cannot provide it either. If you need more control, you should manage the playlist by yourself (and this is not a limitation of the python bindings).


Return to “Development around libVLC”

Who is online

Users browsing this forum: m1adow and 7 guests