[vlc-devel] Re: Option drawable
Olivier Aubert
oaubert at lisi.univ-lyon1.fr
Wed Sep 6 23:49:13 CEST 2006
> It seems like I can inform vlc of a window ID where it should reproduce
> the input stream.
> Has anybody ever used this option. Is it possible to do this?.
Yes, this functionality is for instance exposed by the python binding.
See below for a short example,
http://svn.gna.org/viewcvs/advene/trunk/bin/sample_player for the same
example with player controls, and http://liris.cnrs.fr/advene/ for a
real application using it.
Olivier
--
#! /usr/bin/python
import gtk
import sys
import vlc
class VideoPlayer:
def __init__(self):
self.mc=vlc.MediaControl( [ ] )
if sys.argv[1:]:
self.mc.playlist_add_item(sys.argv[1])
self.drawable=gtk.DrawingArea()
self.drawable.set_size_request(320,200)
def popup(self):
w=gtk.Window()
w.add(self.drawable)
w.show_all()
# Now that self.drawable is realized, its xid is available
if sys.platform == 'win32':
xidattr='handle'
else:
xidattr='xid'
self.mc.set_visual(getattr(self.drawable.window, xidattr))
w.connect("destroy", gtk.main_quit)
return w
def main(self):
self.popup()
self.mc.start(0)
gtk.main()
if __name__ == '__main__':
p=VideoPlayer()
p.main()
--
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
More information about the vlc-devel
mailing list