Author: duncan
Date: Thu Jan  4 22:39:33 2007
New Revision: 8928

Modified:
   branches/rel-1/freevo/src/www/htdocs/fileinfo.rpy
   branches/rel-1/freevo/src/www/htdocs/library.rpy
   branches/rel-1/freevo/src/www/web_types.py

Log:
Play using vlc and changes to images
Patches from Chandan and Wout applied


Modified: branches/rel-1/freevo/src/www/htdocs/fileinfo.rpy
==============================================================================
--- branches/rel-1/freevo/src/www/htdocs/fileinfo.rpy   (original)
+++ branches/rel-1/freevo/src/www/htdocs/fileinfo.rpy   Thu Jan  4 22:39:33 2007
@@ -55,7 +55,7 @@
         
         if file:
             medium = metadata.parse(file)
-            print medium
+            #print medium
             title = ""
             info = "<table>"
             (basedir, item) = os.path.split(file)
@@ -106,25 +106,42 @@
                u"doc.getElementById('file-head').innerHTML = '%s';\n"\
                u"doc.getElementById('file-info').innerHTML = '%s';\n"\
                u"doc.getElementById('file-play-button').onclick = %s;\n"\
+               u"doc.getElementById('file-play-using-vlc').onclick = %s;\n"\
                u"doc.getElementById('program-waiting').style.display = 
'none';\n" \
                u"doc.getElementById('program-info').style.visibility = 
'visible';\n" \
                u"</script>\n"
             ) % ( Unicode(title.replace("'", "\\'")),
                   Unicode(info.replace("'", "\\'")),
-                  "function() { window.open(\"%s\"); }" % (file_link),    
+                  "function() { window.open(\"%s\"); }" % (file_link),
+                  '\
+                  function() { \
+                      vlc_window = window.open(""); \
+                      vlc_window.document.write(\'<html><head><title>VLC 
Player</title></head><body>\'); \
+                      vlc_window.document.write(\'<embed 
type="application/x-vlc-plugin" name="video" autoplay="yes" \'); \
+                      vlc_window.document.write(\'width="640" height="480" 
target="http://\'); \
+                      vlc_window.document.write(location.hostname + \':\' + 
location.port + \'/' + urllib.quote(file_link) + '"/><br/>\'); \
+                      vlc_window.document.write(\'<a href="javascript:;" 
onclick="document.video.play()">Play</a>&nbsp\'); \
+                      vlc_window.document.write(\'<a href="javascript:;" 
onclick="document.video.pause()">Pause</a>&nbsp\'); \
+                      vlc_window.document.write(\'<a href="javascript:;" 
onclick="document.video.stop()">Stop</a>&nbsp\'); \
+                      vlc_window.document.write(\'<a href="javascript:;" 
onclick="document.video.fullscreen()">Fullscreen</a>\'); \
+                      vlc_window.document.write(\'</body></html>\'); \
+                  }\
+                  '
             )           
 
         elif img:
             _img = img.split("_")#
             img_name = _img[len(_img)-1]
+            height = fv.formValue(form, 'h')
+            width = fv.formValue(form, 'w')
             fv.res += (
                u"<html>" \
                u"<head><title>%s</title>" \
                u"<link href=\"styles/main.css\" rel=\"stylesheet\" 
type=\"text/css\" /></head>" \
                u"<body>"\
-               u"<img src=\"%s\" />"\
+               u"<img src=\"%s\" height=\"%s\" width=\"%s\" />"\
                u"</body></html>"
-            ) % ( img_name, img )
+            ) % ( img_name, img, height, width )
             
         return String(fv.res)
     

Modified: branches/rel-1/freevo/src/www/htdocs/library.rpy
==============================================================================
--- branches/rel-1/freevo/src/www/htdocs/library.rpy    (original)
+++ branches/rel-1/freevo/src/www/htdocs/library.rpy    Thu Jan  4 22:39:33 2007
@@ -577,6 +577,10 @@
             u"                        <td id=\"file-play-button\">\n"\
             u"                           "+_('Play file')+u"\n"\
             u"                        </td>\n"\
+            u"                        <td id=\"file-play-using-vlc\">\n"\
+            u"                        "+_('Play file using VLC')+u"\n"\
+            u"                        "+''+u"\n"\
+            u"                        </td>\n"\
             u"                        <td id=\"program-favorites-button\">\n"\
             #u"                        "+_('Play file on Freevo')+u"\n"\
             u"                        "+''+u"\n"\

Modified: branches/rel-1/freevo/src/www/web_types.py
==============================================================================
--- branches/rel-1/freevo/src/www/web_types.py  (original)
+++ branches/rel-1/freevo/src/www/web_types.py  Thu Jan  4 22:39:33 2007
@@ -441,12 +441,27 @@
         """
         print 'printImagePopup(self)'
         self.res += """<script language="JavaScript" type="text/javascript" 
style="display:none;">
-        function openfoto(loc,width,height){
-            if (width >= screen.width || height >= screen.height) {
+        var width = 0;
+        var height = 0;
+        var max_width = screen.width - 100;
+        var max_height = screen.height;
+        
+        function openfoto(loc,width_img,height_img){
+            width = width_img;
+            height = height_img;
+            
+            if (width >= max_width || height >= max_height) {
                 scrollbars = 'yes';
+                getNewSize();
             }
-            var 
params="toolbar=no,location=no,status=no,menubar=no,resizable=no,scrollbars="+scrollbars+",top=0,left=0,width="+width+",height="+height;
-            foto = window.open("fileinfo.rpy?img="+loc,"Images",params);
+            var 
params="toolbar=no,location=no,status=no,menubar=yes,resizable=no,scrollbars="+scrollbars+",top=0,left=0,width="+width+",height="+height;
+            foto = 
window.open("fileinfo.rpy?img="+loc+"&w="+width+"&h="+height,"Images",params);
+        }
+        
+        function getNewSize(){
+        //this is not correct!
+            height = Math.round(height * (max_width / width));
+            width = Math.round(width * (max_height / height));
         }
         </script> """
 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to