Page 1 of 1
what do I use to know when a song has ended?
Posted: 10 Nov 2022 16:51
by whalehead
Hello all, first post. I'm working with libVLC through a smalltalk FFI interface. I'm managing my playlists and sending a track to mediaPlayer one at a time (I'm not using mediaListPlayer - as I want to manage the playlist myself). However, I need to know when a song ends (not stopped, per se, but ends while playing?) so I can send the next song in the playlist.
Is there something specific I can monitor on the mediaPlayer to designate the song has ended? position = 1.0?, idk.
Thanks!
Re: what do I use to know when a song has ended?
Posted: 15 Nov 2022 07:31
by mfkl
There are events on the mediaplayer type that you can use to get notified of things. They are callbacks. The one you'd want is likely `MediaPlayerEndReached`
Re: what do I use to know when a song has ended?
Posted: 15 Nov 2022 14:20
by whalehead
There are events on the mediaplayer type that you can use to get notified of things. They are callbacks. The one you'd want is likely `MediaPlayerEndReached`
Thanks! Now I have to learn how to use callbacks through my uFFI (unified Foreign Function Interface) facility in my IDE. hehe, always something to learn!
Re: what do I use to know when a song has ended?
Posted: 18 Nov 2022 23:07
by whalehead
I have searched and searched for 'MediaPlayerEndReached' and I cannot find it anywhere in the documentation at 'https : // videolan.videolan.me/vlc'. I've done google searches for 'MediaPlayerEndReached' and they appear to point to callbacks that no longer exist? Forum posts from 2008. Can anyone give me a link to the documentation on vlc's media player end reached?
If you have a sample of how to use the callback, that would be great also... I'm going to have to code it myself in my uFFI facility - and while I have a couple other examples of VLC callbacks there - I'd be grateful to see how it's done for mediaPlayerEndReached.
Thanks!