return info on current playlist item
Posted: 22 Nov 2008 11:01
by innerspace
I have an application built around libvlc and I need to read the filename of the playlist item that is currently playing.
Are there any handles to achieve this or would I need to modify VLC directly?
Re: return info on current playlist item
Posted: 23 Nov 2008 22:48
by erwan10
If you stick to libvlc api, the right functions should be :
If you use media list, use the media player associated to it to retrieve the media currently being played back :
libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
Once you get the media, ask for its mrl :
char * libvlc_media_get_mrl( libvlc_media_t * p_md, libvlc_exception_t * p_e );
If you still use playlist (deprecated in libvlc api), use the following to get the media player associated to it and do as above :
libvlc_media_player_t * libvlc_playlist_get_media_player(libvlc_instance_t *, libvlc_exception_t * );