Archivo

Entradas Etiquetadas ‘video’

See YouTube Videos On Small Browser

jueves, 18 de septiembre de 2008 2 comentarios

See YouTube Videos On Small Browser

Here is the python source code:

#!/usr/bin/python
# albertux <albertoi7@gmail.com>
# 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 ='<body style="background-color:black"><object width="100%" height="100%"><param name="movie" value="http://www.youtube.com/swf/l.swf?video_id='+id+'&rel=1&iurl=null&color1=0x2b405b&color2=0x6b8ab6&autoplay=1"></param><param name="allowFullScreen" value="true"></param><embed src="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" allowfullscreen="true" width="100%" height="100%"></embed></object></body>'
 
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.

Categories: unix/linux, web Tags: , , ,

Embed Videos to MRL

miércoles, 16 de julio de 2008 Sin comentarios

Embed Videos to MRL

Aunque ya había desarrollado un código que insertaba el vídeo en MRL, me di cuenta de que el servidor no soportaba Python, pero si tenia soporte para Perl, así que después de leer un poco, este es el resultado:

[ Video Tester ]

Espero tener mas avances de MRL en las próximas semanas.

Urls de vídeos soportados: YouTube, Metacafe, Dailymotion., Megavideo, Vreel, Wuapi.

Categories: projects Tags: , , ,

Switch to our mobile site