#!/usr/bin/env python

import sys, os
import gobject, glib
import pygst
pygst.require ("0.10")
import gst

class Main:
    def __init__(self):
        self.player = gst.element_factory_make ("playbin2", "playbin2")
        fakesink = gst.element_factory_make ("fakesink", "fakesink")
        self.player.set_property ("video-sink", fakesink)
        fakesink = gst.element_factory_make ("fakesink", "fakesink")
        self.player.set_property ("audio-sink", fakesink)
        bus = self.player.get_bus()
        bus.add_signal_watch ()
        bus.connect ("message", self.on_message)

    def on_message (self, bus, message):
        print message.type


loop = glib.MainLoop(None, False)
main = Main()
main.player.set_property("uri", sys.argv[1])
main.player.set_state(gst.STATE_PAUSED)
loop.run()
