Help with Python Bindings - setmedia
Posted: 01 Oct 2017 22:23
I am creating a simple media player. I have a function called play_song(). This function sets the media and then plays it (or tries to). The 1st time I call the function, it works, but the 2nd time I call the function, it hangs on set_media(). I have no clue why. Below is an excerpt. The full code is here - https://pastebin.com/SKM6sbey.
The 2nd call to the function:
Code: Select all
def play_song(self):
self.mediaplayer.set_media(self.media)
self.mediaplayer.play()
Code: Select all
def play_next_song(self):
if self.current_song_index < len(self.numbered_list) - 1:
self.current_song_index += 1
self.media = self.instance.media_new(self.numbered_list[self.current_song_index][1])
self.play_song()
def SongFinished(self, event):
self.play_next_song()