From db92ea54e43eeecce47ad353befec57d715cedd1 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Mon, 27 Dec 2010 16:03:33 +0100 Subject: Prevent forceful seeking to beginning of video on playback --- airplay.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/airplay.py b/airplay.py index 2493764..b37a386 100644 --- a/airplay.py +++ b/airplay.py @@ -62,9 +62,12 @@ class AirPlayTotemPlayer(AirPlayService): while (int(duration) == 0): duration = float(self.totem.get_property('stream-length') / 1000) time.sleep(1) - # we also get a start time from the device, so seek to it + # we also get a start time from the device targetoffset = float(duration * float(self.location[1])) - self.set_scrub(targetoffset) + position = float(self.totem.get_property('current-time') / 1000) + # only seek to it if it's above current time, since the video is already playing + if (targetoffset > position): + self.set_scrub(targetoffset) if (not self.totem.is_playing()): self.totem.action_play() -- cgit v1.1-32-gdbae