See YouTube Videos On Small Browser
September 18th, 2008
See YouTube Videos On Small Browser
Here is the python source code:
#!/usr/bin/python # albertux # see a mini youtube video on resizable window # this script could be better import sys if (len(sys.argv)==1) : print "~$ script url_video" sys.exit() # exit if not url URL = sys.argv[1] import gtk import gtkmozembed import re # id of the YouTube Video m = re.search('(?<=v=).{11}',URL) id = m.group(0) # html code to render on the small web browser data ='<object width="100%" height="100%" data="http://www.youtube.com/swf/l.swf?video_id='+id+'&rel=1&iurl=null&color1=0x2b405b&color2=0x6b8ab6&autoplay=1" type="application/x-shockwave-flash"> <param name="allowFullScreen" value="true" /> <param name="src" value="http://www.youtube.com/swf/l.swf?video_id='+id+'&rel=1&iurl=null&color1=0x2b405b&color2=0x6b8ab6&autoplay=1" /> <param name="allowfullscreen" value="true" /></object>' def CloseWindow(caller_widget): """Close the window and exit the app""" gtk.main_quit() win = gtk.Window() win.set_title("Small Web Browser") win.set_position(gtk.WIN_POS_NONE) # general put the window on the top left corner win.set_resizable(True) # resizable window win.connect("destroy", CloseWindow) gtkmozembed.set_profile_path("/tmp", "simple_browser_user") mozbrowser = gtkmozembed.MozEmbed() # gtkmozembed win.add(mozbrowser) win.show_all() mozbrowser.set_size_request(272,223) #size of the window # show the video on the small web browser mozbrowser.render_data(data, long(len(data)), 'file:///', 'text/html') gtk.main()
Screens:
Im think write a support for wuapi, megavideo and other videosites.

Nice - I hope you this for implement other sites as well.
Sorry for the second comment. For those in linux, you need the gnome-python2-gtkmozembed package for this to work. In Fedora, you can install it using
sudo yum install gnome-python2-gtkmozembed