[Laszlo-checkins] r13842 - in openlaszlo/trunk: lps/components/av lps/components/extensions/av test/video

sallen@openlaszlo.org sallen at openlaszlo.org
Fri May 8 16:37:57 PDT 2009


Author: sallen
Date: 2009-05-08 16:37:42 -0700 (Fri, 08 May 2009)
New Revision: 13842

Added:
   openlaszlo/trunk/test/video/test-videoplayer-resize.lzx
   openlaszlo/trunk/test/video/test-videoplayer-setargs.lzx
Modified:
   openlaszlo/trunk/lps/components/av/videoplayer.lzx
   openlaszlo/trunk/lps/components/av/videoscreen.lzx
   openlaszlo/trunk/lps/components/extensions/av/mediastream.lzx
   openlaszlo/trunk/test/video/example-mediastream.lzx
   openlaszlo/trunk/test/video/list.html
   openlaszlo/trunk/test/video/test-videoplayer-http.lzx
Log:
Change 20090508-sallen-K by sallen at sallen-mac.local on 2009-05-08 16:34:18 PDT
    in /Users/sarah/src/svn/openlaszlo/trunk-bugfix
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: fixes youtube, visual behavior of videoplayer reverted to pre 4.2 behavior 

New Features: n/a

Bugs Fixed: LPP-8080  youtube player badly broken in 4.3


Technical Reviewer: max
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation: none 

Release Notes:

Details: 
    

Tests: 
new test files cover the resizing and dynamic playback of the YouTube app




Modified: openlaszlo/trunk/lps/components/av/videoplayer.lzx
===================================================================
--- openlaszlo/trunk/lps/components/av/videoplayer.lzx	2009-05-08 22:08:01 UTC (rev 13841)
+++ openlaszlo/trunk/lps/components/av/videoplayer.lzx	2009-05-08 23:37:42 UTC (rev 13842)
@@ -119,7 +119,8 @@
 
        <simplelayout axis="y" spacing="${parent.sliderGap}"/>  
        <videoscreen name="vscreen" debug="${parent.debug}" 
-            width="${parent.screenWidth}"
+            width="${parent.width}"
+            height="${parent.height - parent.sliderGap - parent.sliderHeight}"
             visible="${parent.showscreen}"
             type="${classroot.type}"
             autoplay="${classroot.autoplay}"
@@ -133,7 +134,7 @@
             aspectRatio="${parent.aspectRatio}"
             />
         <videoslider name="vslider"
-            width="${parent.screenWidth}"
+            width="${parent.width}"
             height="${parent.sliderHeight}"
             visible="${parent.showslider}"
             ms="${classroot.vscreen.ms}"

Modified: openlaszlo/trunk/lps/components/av/videoscreen.lzx
===================================================================
--- openlaszlo/trunk/lps/components/av/videoscreen.lzx	2009-05-08 22:08:01 UTC (rev 13841)
+++ openlaszlo/trunk/lps/components/av/videoscreen.lzx	2009-05-08 23:37:42 UTC (rev 13842)
@@ -34,13 +34,18 @@
         <attribute name="borderTop" value="5"/>
 
         <attribute name="borderBottom" value="5"/>
-        
-        <!--- if non-zero, then this will be used to maintain the
-              aspect ratio based on the width of the videoscreen.
-              Default: 4/3
-        -->
-        <attribute name="aspectRatio" value="$once{4/3}"/>
 
+        <attribute name="aspectRatio" value="$once{
+            4 / 3}"/>
+
+        <attribute name="videoWidth" value="${
+            Math.min(this.innerWidth,
+                     this.innerHeight * this.aspectRatio)}"/>
+
+        <attribute name="videoHeight" value="${
+            Math.min(this.innerHeight,
+                     this.innerWidth / this.aspectRatio)}"/>
+
         <!--- the actual width of the videoview 
             @access private
         -->
@@ -51,12 +56,8 @@
             @access private
         -->
         <attribute name="innerHeight" value="${
-            aspectRatio &gt; 0 ?
-            Math.round(this.innerWidth * 1 / this.aspectRatio)
-            : this.height - (this.borderTop + this.borderBottom)}"/>
+            this.height - (this.borderTop + this.borderBottom)}"/>
 
-        <attribute name="height" value="${this.borderTop + this.borderLeft +
-                   this.innerHeight}"/>
         <mediastream 
             name="ms"
             autoplay="${classroot.autoplay}"
@@ -65,13 +66,12 @@
             debug="${parent.debug}" 
         />
 
-
         <videoview 
             name="vv"
-            x="${parent.borderLeft}"
-            y="${parent.borderTop}"
-            width="${parent.innerWidth}"
-            height="${parent.innerHeight}"
+            x="${parent.borderLeft + (parent.innerWidth-parent.videoWidth)/2}"
+            y="${parent.borderTop + (parent.innerHeight-parent.videoHeight)/2}"
+            width="${parent.videoWidth}"
+            height="${parent.videoHeight}"
             stream="$once{classroot.ms}"
             visible="${parent.visible &amp;&amp; (this.width &gt; 1) &amp;&amp; (this.height &gt; 1)}"
             playvolume="${classroot.volume}"

Modified: openlaszlo/trunk/lps/components/extensions/av/mediastream.lzx
===================================================================
--- openlaszlo/trunk/lps/components/extensions/av/mediastream.lzx	2009-05-08 22:08:01 UTC (rev 13841)
+++ openlaszlo/trunk/lps/components/extensions/av/mediastream.lzx	2009-05-08 23:37:42 UTC (rev 13842)
@@ -389,9 +389,6 @@
 
         this.setAttribute("time", 0);
         this.setAttribute("progress", 0.0);
-        // note the mode 'playing' means playing, as opposed to recording or
-        // broadcasting.  It also includes the 'paused' state
-        this.setAttribute("mode", "playing");
         
         // call internal play method after start, length, and reset params 
         // have been translated into confusing flash player values
@@ -413,6 +410,10 @@
                 return;
             }
         }                            
+        // note the mode 'playing' means playing, as opposed to recording or
+        // broadcasting.  It also includes the 'paused' state
+        this.setAttribute("mode", "playing");
+
         if ($debug && !this._flashstream) {
             Debug.warn('mediastream %w unexpected _flashstream=%w', 
                 this, this._flashstream); 
@@ -1227,6 +1228,7 @@
           the stream will be in a paused state.
     -->
     <method name="seek" args="t"> <![CDATA[
+        if (url == "") return;
 
         if (!this._flashstream) {
             this._createStream("seek", [t]);

Modified: openlaszlo/trunk/test/video/example-mediastream.lzx
===================================================================
--- openlaszlo/trunk/test/video/example-mediastream.lzx	2009-05-08 22:08:01 UTC (rev 13841)
+++ openlaszlo/trunk/test/video/example-mediastream.lzx	2009-05-08 23:37:42 UTC (rev 13842)
@@ -5,8 +5,11 @@
 <!-- this is the example from the mediastream doc -->
 <canvas>
           <mediastream name="ms" autoplay="true" type="http"
+            url="http:videos/good-dog.flv"
+          debug="true" />
+          <!--
           url="http://www.archive.org/download/JudgeMediaTestVideoFile_0/video.flv"
-          debug="true" />
+          -->
            <videoview type="http" autoplay="true" width="320" height="240" 
                 stream="canvas.ms" debug="true"/>
 </canvas>

Modified: openlaszlo/trunk/test/video/list.html
===================================================================
--- openlaszlo/trunk/test/video/list.html	2009-05-08 22:08:01 UTC (rev 13841)
+++ openlaszlo/trunk/test/video/list.html	2009-05-08 23:37:42 UTC (rev 13842)
@@ -3,118 +3,142 @@
 * Use is subject to license terms.                                       *
 * X_LZ_COPYRIGHT_END ************************************************** -->
 <html>
-<p><a href="readme.txt" target="display">readme.txt</a></p>
+<head>
+<script>
+function runtest(url) {
+    var div = document.getElementById("current");
+    div.innerHTML = "Now playing:<br/>" + url
+    window.top.frames.display.location = url;
+    return void(0);
+}
+</script>
+</head>
+<body style="font-size:11px">
+<div id="current">
+</div>
+<p><a href="javascript:runtest('readme.txt')">readme.txt</a></p>
 <hr/>
 <p>doc examples: worked in 4.2, still work</p>
 <p>example-mediastream.lzx
 <br/>
-<a href="example-mediastream.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="example-mediastream.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('example-mediastream.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('example-mediastream.lzx?debug=true&lzr=swf9')">swf9</a>,
 </p>
 <p>
 example-rtmpconnection.lzx
 <br/>
-<a href="example-rtmpconnection.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="example-rtmpconnection.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('example-rtmpconnection.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('example-rtmpconnection.lzx?debug=true&lzr=swf9')">swf9</a>,
 </p>
 <p>
 example-videoview.lzx
 <br/>
-<a href="example-videoview.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="example-videoview.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('example-videoview.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('example-videoview.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <hr/>
 <p>these work in swf8 and swf9</p>
 <p>
 test-videoplayer-http.lzx
 <br/>
-<a href="test-videoplayer-http.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-videoplayer-http.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-videoplayer-http.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-videoplayer-http.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
-
 <p>
+test-videoplayer-setargs.lzx
+<br/>
+<a href="javascript:runtest('test-videoplayer-setargs.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-videoplayer-setargs.lzx?debug=true&lzr=swf9')">swf9</a>
+</p
+<p>
+test-videoplayer-resize.lzx
+<br/>
+<a href="javascript:runtest('test-videoplayer-resize.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-videoplayer-resize.lzx?debug=true&lzr=swf9')">swf9</a>
+</p
+<p>
 test-rtmpconnection.lzx
 <br/>
-<a href="test-rtmpconnection.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-rtmpconnection.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-rtmpconnection.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-rtmpconnection.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <p>
 test-videoview.lzx
 <br/>
-<a href="test-videoview.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-videoview.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-videoview.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-videoview.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <p>
 test-camera.lzx
 <br/>
-<a href="test-camera.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-camera.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-camera.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-camera.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <p>
 test-multiple-videos.lzx
 <br/>
-<a href="test-multiple-videos.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-multiple-videos.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-multiple-videos.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-multiple-videos.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <p>
 test-stream-video-rtmp-sep.lzx
 <br/>
-<a href="test-stream-video-rtmp-sep.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-stream-video-rtmp-sep.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-stream-video-rtmp-sep.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-stream-video-rtmp-sep.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <p>
 test-stream-video-sep.lzx
 <br/>
-<a href="test-stream-video-sep.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-stream-video-sep.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-stream-video-sep.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-stream-video-sep.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <p>
 test-video-rtmp.lzx
 <br/>
-<a href="test-video-rtmp.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-video-rtmp.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-video-rtmp.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-video-rtmp.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <p>
 test-video.lzx
 <br/>
-<a href="test-video.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-video.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-video.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-video.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <p>
 test-stream-video.lzx
 <br/>
-<a href="test-stream-video.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-stream-video.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-stream-video.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-stream-video.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <hr/>
 <p> these work in swf8, not in swf9
 <p>
 test-recording.lzx 
 <br/>
-<a href="test-recording.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-recording.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-recording.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-recording.lzx?debug=true&lzr=swf9')">swf9</a>,
 </p>
 <hr/>
 <p>tested in swf8, untestedin swf9</p>
 <p>
 test-record-audio.lzx
 <br/>
-<a href="test-record-audio.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-record-audio.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-record-audio.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-record-audio.lzx?debug=true&lzr=swf9')">swf9</a>,
 </p>
 <hr/>
 <p>untested</p>
 <p>
 test-live-echo.lzx
 <br/>
-<a href="test-live-echo.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-live-echo.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-live-echo.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-live-echo.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <p>
 test-muting-and-playing.lzx (broadcast)
 <br/>
-<a href="test-muting-and-playing.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-muting-and-playing.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-muting-and-playing.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-muting-and-playing.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 
 <hr/>
@@ -122,31 +146,32 @@
 <p>
 test-camera-mute-multiple.lzx
 <br/>
-<a href="test-camera-mute-multiple.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-camera-mute-multiple.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-camera-mute-multiple.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-camera-mute-multiple.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <p>
 test-live
 <br/>
-<a href="test-live.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-live.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-live.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-live.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <p>
 test-live-echo
 <br/>
-<a href="test-live-echo.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-live-echo-multiple.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-live-echo.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-live-echo-multiple.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <p>
 test-live-sep.lzx
 <br/>
-<a href="test-live-sep.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-live-sep.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-live-sep.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-live-sep.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
 <p>
 test-microphone-recording.lzx
 <br/>
-<a href="test-microphone-recording.lzx?debug=true&lzr=swf8" target="display">swf8</a>,
-<a href="test-microphone-recording.lzx?debug=true&lzr=swf9" target="display">swf9</a>
+<a href="javascript:runtest('test-microphone-recording.lzx?debug=true&lzr=swf8')">swf8</a>,
+<a href="javascript:runtest('test-microphone-recording.lzx?debug=true&lzr=swf9')">swf9</a>
 </p>
+</body>
 </html>

Modified: openlaszlo/trunk/test/video/test-videoplayer-http.lzx
===================================================================
--- openlaszlo/trunk/test/video/test-videoplayer-http.lzx	2009-05-08 22:08:01 UTC (rev 13841)
+++ openlaszlo/trunk/test/video/test-videoplayer-http.lzx	2009-05-08 23:37:42 UTC (rev 13842)
@@ -18,7 +18,7 @@
             border="1" sliderGap="0"
             url="http:videos/good-dog.flv"
             type="http"    
-            width="302"/>     
+            width="320" height="256"/>
         <text text="${'playing='+v1.stream.playing}"/>
         <text text="${'paused='+v1.stream.paused}"/>
         <text></text>
@@ -29,10 +29,10 @@
               v2: autoplay=true<br/>
               defaults for visual layout
         </text>
-        <videoplayer id="v2" debug="true"
+        <videoplayer id="v2" 
         url="http:videos/good-dog.flv"
         type="http" autoplay="true"
-        width="320" />
+        width="320" height="261"/>
         <text text="${'playing='+v2.stream.playing}"/>
         <text text="${'paused='+v2.stream.paused}"/>
         <text></text>

Added: openlaszlo/trunk/test/video/test-videoplayer-resize.lzx


Property changes on: openlaszlo/trunk/test/video/test-videoplayer-resize.lzx
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: openlaszlo/trunk/test/video/test-videoplayer-setargs.lzx


Property changes on: openlaszlo/trunk/test/video/test-videoplayer-setargs.lzx
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native



More information about the Laszlo-checkins mailing list