Changes
Jump to navigation
Jump to search
Line 143:
Line 143:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Development Team/Almanac/GStreamer (view source)
Revision as of 11:18, 3 October 2008
, 11:18, 3 October 2008→How can I embed video files in my activity?
self.gplayWin.resize( 300, 400 )
self.gplayWin.resize( 300, 400 )
self.gplayWin.show_all( )
self.gplayWin.show_all( )
</pre>
Alternatively, you could embed your video into a gtk.DrawingArea:
<pre>
class VideoWidget(gtk.DrawingArea):
def __init__(self):
gtk.DrawingArea.__init__(self)
self.set_events(gtk.gdk.POINTER_MOTION_MASK |
gtk.gdk.POINTER_MOTION_HINT_MASK |
gtk.gdk.EXPOSURE_MASK |
gtk.gdk.KEY_PRESS_MASK |
gtk.gdk.KEY_RELEASE_MASK)
self.imagesink = None
self.unset_flags(gtk.DOUBLE_BUFFERED)
self.set_flags(gtk.APP_PAINTABLE)
def do_expose_event(self, event):
if self.imagesink:
self.imagesink.expose()
return False
else:
return True
def set_sink(self, sink):
assert self.window.xid
self.imagesink = sink
self.imagesink.set_xwindow_id(self.window.xid)
</pre>
</pre>