def on_play_pause(self):
        if self.player.playing:
            self.player.pause()
        else:
            if self.player.time >= self.player.source.duration:
                self.player.seek(0)
            self.player.play()
        self.gui_update_state()
dataset/ETHPy150Open ardekantur/pyglet/examples/media_player.py/PlayerWindow.on_play_pause/original