i need to change media if current came to end, for this i attached an event, but script just stucks on string: media_player.set_media(media) in event_end_reached_listener.
But if i comment attaching an event and execute this function manualy, everything works perfect.
what do i do wrong?
here's a simplified version of code:
Code: Select all
import vlc
def event_end_reached_listener(event):
media = vlc_instance.media_new("2.avi")
media_player.set_media(media)
media_player.play()
vlc_instance = vlc.Instance()
media_player = vlc_instance.media_player_new()
media = vlc_instance.media_new("1.avi")
em = media_player.event_manager()
em.event_attach(vlc.EventType.MediaPlayerEndReached, event_end_reached_listener)
media_player.set_media(media)
media_player.play()