what do I use to know when a song has ended?

This forum is about all development around libVLC.
whalehead
New Cone
New Cone
Posts: 3
Joined: 10 Nov 2022 16:44

what do I use to know when a song has ended?

Postby whalehead » 10 Nov 2022 16:51

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!

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: what do I use to know when a song has ended?

Postby mfkl » 15 Nov 2022 07:31

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`
https://mfkl.github.io

whalehead
New Cone
New Cone
Posts: 3
Joined: 10 Nov 2022 16:44

Re: what do I use to know when a song has ended?

Postby whalehead » 15 Nov 2022 14:20

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! :D

whalehead
New Cone
New Cone
Posts: 3
Joined: 10 Nov 2022 16:44

Re: what do I use to know when a song has ended?

Postby whalehead » 18 Nov 2022 23:07

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!


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 7 guests