diff options
| author | 2010-12-27 16:03:33 +0100 | |
|---|---|---|
| committer | 2010-12-27 16:08:21 +0100 | |
| commit | db92ea54e43eeecce47ad353befec57d715cedd1 (patch) | |
| tree | 986fb6923ef0903662a7be01964f0ede95001712 | |
| parent | eb9d750f59161f2bf0a55b4e75b56e65e6f7b432 (diff) | |
| download | totem-plugin-airplay-db92ea54e43eeecce47ad353befec57d715cedd1.tar.gz totem-plugin-airplay-db92ea54e43eeecce47ad353befec57d715cedd1.tar.bz2 | |
Prevent forceful seeking to beginning of video on playback
| -rw-r--r-- | airplay.py | 7 |
1 files changed, 5 insertions, 2 deletions
| @@ -62,9 +62,12 @@ class AirPlayTotemPlayer(AirPlayService): | |||
| 62 | while (int(duration) == 0): | 62 | while (int(duration) == 0): |
| 63 | duration = float(self.totem.get_property('stream-length') / 1000) | 63 | duration = float(self.totem.get_property('stream-length') / 1000) |
| 64 | time.sleep(1) | 64 | time.sleep(1) |
| 65 | # we also get a start time from the device, so seek to it | 65 | # we also get a start time from the device |
| 66 | targetoffset = float(duration * float(self.location[1])) | 66 | targetoffset = float(duration * float(self.location[1])) |
| 67 | self.set_scrub(targetoffset) | 67 | position = float(self.totem.get_property('current-time') / 1000) |
| 68 | # only seek to it if it's above current time, since the video is already playing | ||
| 69 | if (targetoffset > position): | ||
| 70 | self.set_scrub(targetoffset) | ||
| 68 | 71 | ||
| 69 | if (not self.totem.is_playing()): | 72 | if (not self.totem.is_playing()): |
| 70 | self.totem.action_play() | 73 | self.totem.action_play() |
