Hi, the API changed a bit in 4.0, where this was added:
https://videolan.videolan.me/vlc/group_ ... track.html
In 3.0.x, you could use the following events:
- libvlc_MediaPlayerESAdded
- libvlc_MediaPlayerESDeleted
- libvlc_MediaPlayerESSelected
- libvlc_MediaPlayerESUpdated
(see
https://videolan.videolan.me/vlc/group_ ... 2392f62fc6)
As well as those direct functions:
Code: Select all
/**
* Get current video subtitle.
*
* \param p_mi the media player
* \return the video subtitle selected, or -1 if none
*/
LIBVLC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
/**
* Get the number of available video subtitles.
*
* \param p_mi the media player
* \return the number of available video subtitles
*/
LIBVLC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
/**
* Get the description of available video subtitles.
*
* \param p_mi the media player
* \return list containing description of available video subtitles.
* It must be freed with libvlc_track_description_list_release()
*/
LIBVLC_API libvlc_track_description_t *
libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
/**
* Set new video subtitle.
*
* \param p_mi the media player
* \param i_spu video subtitle track to select (i_id from track description)
* \return 0 on success, -1 if out of range
*/
LIBVLC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu );
(from
https://code.videolan.org/videolan/vlc/ ... er.h#L1208)
which you can also find in python there:
https://www.olivieraubert.net/vlc/pytho ... index.html