Author: max
Date: 2007-11-13 15:40:48 -0800 (Tue, 13 Nov 2007)
New Revision: 7239

Modified:
   openlaszlo/branches/wafflecone/
   openlaszlo/branches/wafflecone/demos/youtube/youtube.jsp
   openlaszlo/branches/wafflecone/demos/youtube/youtube.lzx
Log:
Merged revisions 7237 via svnmerge from 
http://svn.openlaszlo.org/openlaszlo/trunk

.......
  r7237 | max | 2007-11-13 14:29:20 -0800 (Tue, 13 Nov 2007) | 26 lines
  
  Change 20071113-maxcarlson-3 by [EMAIL PROTECTED] on 2007-11-13 13:54:12 PST
      in /Users/maxcarlson/openlaszlo/trunk
      for http://svn.openlaszlo.org/openlaszlo/trunk
  
  Summary: Fix the youtube player
  
  New Features:
  
  Bugs Fixed: LPP-5070 - Videos not playing in YouTube demo
  
  Technical Reviewer: jcrowley
  QA Reviewer: promanik
  Doc Reviewer: (pending)
  
  Documentation:
  
  Release Notes:
  
  Details: youtube.jsp - Add support for passing the 't' parameter though to 
get_video.
  
  youtube.lzx - Use proxied mode - the server helps with http redirect calls 
that sometimes get returned from get_video.
      
  
  Tests: youtube.lzx mostly works now.  
.......



Property changes on: openlaszlo/branches/wafflecone
___________________________________________________________________
Name: svnmerge-integrated
   - 
/openlaszlo/branches/legals:1-5746,5748-5756,5758-5770,5772-5819,5821-5860,5862-5890,5892-6065,6068-6177,6179-6228,6230-6236,6241-6266
 
/openlaszlo/trunk:1-3892,3894-3952,3954-4393,4395-4461,4463-4467,4469-4471,4473-5085,5087-5171,5173-5203,5205-5209,5211-5331,5333-5334,6484-6485,6487,6490-6492,6494-6495,6497,6500-6502,6504-6505,6507-6520,6531-6532,6534-6538,6540-6547,6549,6551-6558,6560-6567,6569-6581,6583-6586,6588,6590-6607,6610-6611,6613-6622,6624-6629,6632-6636,6638-6639,6641-6642,6646-6648,6653,6656-6663,6665-6669,6671-6683,6685-6686,6688-6706,6708-6715
   + 
/openlaszlo/branches/legals:1-5746,5748-5756,5758-5770,5772-5819,5821-5860,5862-5890,5892-6065,6068-6177,6179-6228,6230-6236,6241-6266
 
/openlaszlo/trunk:1-3892,3894-3952,3954-4393,4395-4461,4463-4467,4469-4471,4473-5085,5087-5171,5173-5203,5205-5209,5211-5331,5333-5334,6484-6485,6487,6490-6492,6494-6495,6497,6500-6502,6504-6505,6507-6520,6531-6532,6534-6538,6540-6547,6549,6551-6558,6560-6567,6569-6581,6583-6586,6588,6590-6607,6610-6611,6613-6622,6624-6629,6632-6636,6638-6639,6641-6642,6646-6648,6653,6656-6663,6665-6669,6671-6683,6685-6686,6688-6706,6708-6715,7237

Modified: openlaszlo/branches/wafflecone/demos/youtube/youtube.jsp
===================================================================
--- openlaszlo/branches/wafflecone/demos/youtube/youtube.jsp    2007-11-13 
23:02:22 UTC (rev 7238)
+++ openlaszlo/branches/wafflecone/demos/youtube/youtube.jsp    2007-11-13 
23:40:48 UTC (rev 7239)
@@ -10,10 +10,10 @@
 <%@ page import="org.jdom.xpath.*" %>
 <%!
 
-    /* X_LZ_COPYRIGHT_BEGIN 
****************************************************
-     * Copyright 2007 Laszlo Systems, Inc.  All Rights Reserved.               
*
-     * Use is subject to license terms.                                        
*
-     * X_LZ_COPYRIGHT_END 
******************************************************/
+/* X_LZ_COPYRIGHT_BEGIN ****************************************************
+ * Copyright 2007 Laszlo Systems, Inc.  All Rights Reserved.               *
+ * Use is subject to license terms.                                        *
+ * X_LZ_COPYRIGHT_END ******************************************************/
 
 
     public String devId =
@@ -217,7 +217,8 @@
         Element resultEl =
             new Element("videoGetFlvUrlResult");
 
-               String videoId = "";
+        String videoId = "";
+        String tId = "";
         while (true) {
             String line = null;
 
@@ -236,22 +237,32 @@
             if (start == -1) {
                 continue;
             } else {
-               // Extract the video_id from the args line
-                               Pattern p = 
Pattern.compile("video_id:'[\\w\\d]+'?");
-                               Matcher m = p.matcher(line);
-                               if ( m.find() ) {
-                                   videoId = (line.substring(m.start(), 
m.end()));
-                                   videoId = videoId.substring(10, 
videoId.length()-1);
-                               } else {
-                                       reportError("video_id argument not 
found in HTML page", result);
-                                       return;
-                               }
+                // Extract the video_id from the args line
+                Pattern vidpat = Pattern.compile("video_id:'[\\w\\d]+'?");
+                Pattern tpat = Pattern.compile("t:'[\\w\\d]+'?");
+                Matcher vidmatcher = vidpat.matcher(line);
+                Matcher tmatcher = tpat.matcher(line);
+                if ( vidmatcher.find() ) {
+                    videoId = (line.substring(vidmatcher.start(), 
vidmatcher.end()));
+                    videoId = videoId.substring(10, videoId.length()-1);
+                } else {
+                    reportError("video_id argument not found in HTML page", 
result);
+                    return;
+                }
+                if ( tmatcher.find() ) {
+                    tId = (line.substring(tmatcher.start(), tmatcher.end()));
+                    tId = tId.substring(3, tId.length()-1);
+                } else {
+                    reportError("t argument not found in HTML page", result);
+                    return;
+                }
             }
 
             String url =
-                "http://cache.googlevideo.com/get_video?video_id="; + videoId;
-
+                "http://www.youtube.com/get_video?video_id="; + videoId + "&t=" 
+ tId;
+            
             resultEl.setAttribute("id", videoId);
+            resultEl.setAttribute("t", tId);
             resultEl.setAttribute("url", url);
             result.setRootElement(resultEl);
 

Modified: openlaszlo/branches/wafflecone/demos/youtube/youtube.lzx
===================================================================
--- openlaszlo/branches/wafflecone/demos/youtube/youtube.lzx    2007-11-13 
23:02:22 UTC (rev 7238)
+++ openlaszlo/branches/wafflecone/demos/youtube/youtube.lzx    2007-11-13 
23:40:48 UTC (rev 7239)
@@ -7,9 +7,8 @@
 <canvas
   width="100%"
   height="100%"
-  proxied="false"
+  proxied="true"
 >
-
     
     <include href="av/videoutils.lzx"/>
     <include href="av/videotogglebutton.lzx"/>


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to