Answer the question
In order to leave comments, you need to log in
Why doesn't vlc on pygtk switch to next track?
Hello, I am writing a small player in python using pygtk binding to libvlc.
There is a task at the end of the track to take the next controller il (GetNextTrack function) and play it.
Through the event_manager of the binding, I write the following callback:
def next_track(self,sender):
fname = vlc_controller.GetNextTrack()['url']
self.vlc.player.set_media(instance.media_new(fname,'--network-caching 60000'))
self.vlc.player.play()
Answer the question
In order to leave comments, you need to log in
You're calling libvlc from libvlc and it's brain-breaking. This is a bug.
Ok, let's say. Then I try now to remove the component in the window of which libvlc is displayed:
def endCallback(self,event):
sys.stdout.write('\n\r endCallback')
sys.stdout.flush()
self._mainbox.remove(self.vlc)
self.vlc = None
self.vlc = DecoratedVLCWidget()
sys.stdout.write('\n\r recreatePlayer')
sys.stdout.flush()
fname = vlc_controller.GetNextTrack()['url']
self.vlc.player.set_media(instance.media_new(fname,'--network-caching 60000'))
sys.stdout.write('\n\r after set_media')
sys.stdout.flush()
self.vlc.player.play()
sys.stdout.write('\n\r afterplay')
sys.stdout.flush()
Damn, even the developers agreed that this is a cant
forum.videolan.org/viewtopic.php?f=32&t=108750#p368299
And the phrase "patch welcome" - pleased
So far I've done a workaround via vlc.py MediaPlayerList.
After the end of playback, I add the next track to the list. But there are jambs.
1. The first file in the playlist is played 2 times
2. When a file is deleted from the list, the player is still suspended
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question