def dump_info(player): player.get_window().show() print "Movie now playing:" for key, value in player.get_info().items(): print " %s: %s" % (key.rjust(10), str(value)) print "Keys: space - toggle pause | q - quit | arrows - seek | f - fullscreen | o - toggle OSD"
def output_status_line(player): if player.get_state() != kaa.player.STATE_PLAYING: return length = player.get_info()["length"] pos = player.get_position() if length: percent = (pos/length)*100 else: percent = 0 pos = seconds_to_human_readable(pos) length = seconds_to_human_readable(length) line = "%s / %s (%.1f%%)" % (pos, length, percent) sys.stdout.write("Position: %s\r" % line) sys.stdout.flush() if osd.get_visible(): osd_text.set_text(line)