def __init__(self):
super(VideoPlayerGtk3, self).__init__()
self.uri = ""
# gtk ui
self.movie_window = Gtk.DrawingArea()
self.pack_start(self.movie_window, True, True, 0)
self.button = Gtk.Button(_("Play"))
self.pack_start(self.button, False, True, 0)
self.button.connect("clicked", self.on_play_clicked)
# player
self.player = Gst.ElementFactory.make("playbin2", "player")
# bus stuff
bus = self.player.get_bus()
bus.add_signal_watch()
bus.enable_sync_message_emission()
bus.connect("message", self.on_message)
# FIXME: no sync messages currently so no playing in the widget :/
# the former appears to be not working anymore with GIR, the
# later is not exported (introspectable=0 in the GIR)
bus.connect("sync-message", self.on_sync_message)
#bus.set_sync_handler(self.on_sync_message)
评论列表
文章目录