@param location: time to seek to, in nanoseconds
(self, location)
| 72 | return (position, duration) |
| 73 | |
| 74 | def seek(self, location): |
| 75 | """ |
| 76 | @param location: time to seek to, in nanoseconds |
| 77 | """ |
| 78 | gst.debug("seeking to %r" % location) |
| 79 | event = gst.event_new_seek(1.0, gst.FORMAT_TIME, |
| 80 | gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_ACCURATE, |
| 81 | gst.SEEK_TYPE_SET, location, |
| 82 | gst.SEEK_TYPE_NONE, 0) |
| 83 | |
| 84 | res = self.player.send_event(event) |
| 85 | if res: |
| 86 | gst.info("setting new stream time to 0") |
| 87 | self.player.set_new_stream_time(0L) |
| 88 | else: |
| 89 | gst.error("seek to %r failed" % location) |
| 90 | |
| 91 | def pause(self): |
| 92 | gst.info("pausing player") |