Enforce the Player.loop attribute.
@@ -606,6 +606,19 @@ class Player(pyglet.event.EventDispatcher):
if bl.logger is not None:
bl.logger.log("p.P.oe")
bl.logger.close()
+
+ if self.loop:
+ was_playing = self._playing
+ self.pause()
+ self._mclock.reset()
+
+ if self.source:
+ # Reset source to the beginning
+ self.seek(0.0)
+ self._audio_player.clear()
+ self._set_playing(was_playing)
+
+ else:
self.next_source()
def on_player_next_source(self):
