changeset 598:3842254f101e

auto-rewind in ascoltami Ignore-this: d192a9d5e73fd9608ceabcbdf717e1e2
author drewp@bigasterisk.com
date Sun, 20 Jun 2010 21:09:28 +0000
parents a3b0acd0f83f
children b50e4d43dd3e
files light9/ascoltami/player.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/light9/ascoltami/player.py	Sun Jun 20 21:09:22 2010 +0000
+++ b/light9/ascoltami/player.py	Sun Jun 20 21:09:28 2010 +0000
@@ -45,6 +45,12 @@
             if self.lastWatchTime < self.autoStopTime < t:
                 log.info("autostop")
                 self.pause()
+            if self.isPlaying() and t >= self.duration() - .2:
+                # i don't expect to hit dur exactly with this
+                # polling. What would be better would be to watch for
+                # the EOS signal and react to that
+                self.pause()
+                self.seek(0)
             self.lastWatchTime = t
         except:
             traceback.print_exc()