Sorry, I forgot to mention that I tried to run pyglet loop at the end of
play function and break it after video ends, using on_eos or on_source_eos
events but it don't works. I think these events are not triggered after
video ends.
Updated play method code:
def play(self, filename):
def on_draw():
self.window.clear()
if self._player.source and self._player.source.video_format:
self._player.get_texture().blit(0, 0)
def on_eos():
print('on_eos')
pyglet.app.event_loop.stop() #
def on_player_eos():
print('on_player_eos')
pyglet.app.event_loop.stop()
source = pyglet.media.load(filename, streaming=True)
self._player.push_handlers(on_eos, on_player_eos)
self._player.queue(source)
self._player.play()
self.window.push_handlers(on_draw)
pyglet.app.event_loop.run()
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.