Skip to content
Snippets Groups Projects
Commit 6d3b8ada authored by Thomas Guillem's avatar Thomas Guillem Committed by Rémi Denis-Courmont
Browse files

doc: examples: use the Stopped event

From VLC 4.0, Ended or EndReached are sent when the player is stopping,
so listen to the stopped event instead.
parent 4c73518d
No related branches found
No related tags found
No related merge requests found
......@@ -200,7 +200,7 @@ void Mwindow::updateInterface() { //Update interface and check if song is finish
slider->setValue((int)(pos*1000.0));
/* Stop the media */
if (libvlc_media_player_get_state(vlcPlayer) == libvlc_Ended)
if (libvlc_media_player_get_state(vlcPlayer) == libvlc_Stopped)
this->stop();
}
......
......@@ -122,7 +122,7 @@ MainWindow::MainWindow(const wxString& title) : wxFrame(NULL, wxID_ANY, title, w
vlc_inst = libvlc_new(0, NULL);
media_player = libvlc_media_player_new(vlc_inst);
vlc_evt_man = libvlc_media_player_event_manager(media_player);
libvlc_event_attach(vlc_evt_man, libvlc_MediaPlayerEndReached, ::OnEndReached_VLC, NULL);
libvlc_event_attach(vlc_evt_man, libvlc_MediaPlayerStopped, ::OnEndReached_VLC, NULL);
libvlc_event_attach(vlc_evt_man, libvlc_MediaPlayerPositionChanged, ::OnPositionChanged_VLC, NULL);
Connect(wxID_ANY, vlcEVT_END, wxCommandEventHandler(MainWindow::OnEndReached_VLC));
Connect(wxID_ANY, vlcEVT_POS, wxCommandEventHandler(MainWindow::OnPositionChanged_VLC));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment