python: update python examples to modern python, Gst, and Glib versions
[experiments/gstreamer.git] / python / gst-player-example.py
index b7b838e..0ef074f 100755 (executable)
@@ -27,8 +27,7 @@ Gst.init(None)
 gi.require_version('GstPlayer', '1.0')
 from gi.repository import GstPlayer
 
-from gi.repository import GObject
-GObject.threads_init()
+from gi.repository import GLib
 
 
 class Player(object):
@@ -38,7 +37,7 @@ class Player(object):
         self.player.connect("end-of-stream", self.end_of_stream_cb)
         self.player.connect("state-changed", self.state_changed_cb)
 
-        self.mainloop = GObject.MainLoop()
+        self.mainloop = GLib.MainLoop()
 
     def end_of_stream_cb(self, player):
         self.mainloop.quit()