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

sallen@openlaszlo.org sallen at openlaszlo.org
Thu Jan 8 20:23:10 PST 2009


Author: sallen
Date: 2009-01-08 20:23:09 -0800 (Thu, 08 Jan 2009)
New Revision: 12373

Modified:
   openlaszlo/trunk/lps/components/extensions/av/camera.lzx
   openlaszlo/trunk/lps/components/extensions/av/videoview.lzx
   openlaszlo/trunk/test/video/test-camera.lzx
   openlaszlo/trunk/test/video/test-videoview.lzx
Log:
Change 20090108-sarah-0 by sarah at sarah-allens-macbook-pro.local on 2009-01-08 20:15:08 PST
    in /Users/sarah/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: make it so camera will work if show=true on the tag and fix setters for videoview

New Features: n/a

Bugs Fixed:
 LPP-7186 videoview dose not appear when camera's 'show' is true at initial
 LPP-7585 videoview doesn't use declared width and height in this specific case

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

Documentation: updated camera description to include non-rtmp use case

Release Notes: n/a

Details: camera has special behavior where it shows itself on its immediateparent, part this behavior seems to have been lost along the way, also in videoview we needed to workaround a bug when setters don't get called with the old sntx (I didn't bother to isolate and report since we plan to just refactor the a/v extension to not use the obsolete syntax)
    

Tests:
 test-videoview.lzx now works well, also added a text node to describe what the test should do
  test-camera.lzx also works now, removed the Debug.writes

   both test cases still show a runtime warning, which is unrelated to this fix
   LPP-7572        updateAllAllowed seems to have gotten lost (I think it was defined in media device)



Modified: openlaszlo/trunk/lps/components/extensions/av/camera.lzx
===================================================================
--- openlaszlo/trunk/lps/components/extensions/av/camera.lzx	2009-01-09 04:11:18 UTC (rev 12372)
+++ openlaszlo/trunk/lps/components/extensions/av/camera.lzx	2009-01-09 04:23:09 UTC (rev 12373)
@@ -1,5 +1,5 @@
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2006-2008 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2006-2009 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->
 <library>
@@ -67,6 +67,7 @@
         <method name="_makeDevice"><![CDATA[
             var deviceindex = 
                 this['deviceindex'];
+            //Debug.write('setting up camera device', deviceindex);
 
             var dev = null;
             if ($swf8) {
@@ -76,7 +77,7 @@
                     dev = Camera.get(deviceindex);
                 }
             } else {
-                if ($debug) Debug.warn('%w is not supported in this runtime.', 'camera')
+                if ($Debug) Debug.warn('%w is not supported in this runtime.', 'camera')
             }
             
             this._dev = dev;
@@ -148,12 +149,13 @@
 
             this.show = show;
 
-            // Bail if we're not initialized, the dev isn't
+            // Bail if we're not initialized, the device isn't
             // initialized, or the parent isn't finished initializing
             // (or isn't a videoview).
             if ((!this.isinited) ||
                 (!this._dev) ||
                 (!immediateparent['_initcomplete'])) {
+                if (!immediateparent['cam']) immediateparent.cam = this; 
                 return;
             }
 
@@ -286,7 +288,8 @@
         </method>
 
         <doc>
-            <tag name="shortdesc"><text>A camera that can be connected to a rtmpserver.</text></tag>
+            <tag name="shortdesc"><text>A camera object that can be displayed
+            on a video view and/or broadcast to an rtmpserver.</text></tag>
             <text>
             <p>In order to use a camera in an LZX application, the <attribute>visible</attribute> and <attribute>allowed</attribute> attributes must be set to <attribute>true</attribute>. The <attribute>visible</attribute> indicates the program's intent and the <attribute>allowed</attribute> attribute indicates the user's permission. To protect privacy, camera operation must be explicitly approved by the user.</p>
             <programlisting>

Modified: openlaszlo/trunk/lps/components/extensions/av/videoview.lzx
===================================================================
--- openlaszlo/trunk/lps/components/extensions/av/videoview.lzx	2009-01-09 04:11:18 UTC (rev 12372)
+++ openlaszlo/trunk/lps/components/extensions/av/videoview.lzx	2009-01-09 04:23:09 UTC (rev 12373)
@@ -1,5 +1,5 @@
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2006-2008 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2006-2009 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->
 <library>
@@ -72,7 +72,15 @@
   <script when="immediate"><![CDATA[
     mixin NewvideoviewShared {
         function NewvideoviewShared ( parent:LzView? = null , attrs:Object? = null , children:Array? = null, instcall:Boolean  = false) {
-            super(parent, attrs, children, instcall);
+           if (attrs && attrs['type'] == null) attrs.type = 'http'
+           if (attrs && attrs['autoplay'] == null) attrs.autoplay = false;
+           if (attrs && attrs['cam'] == null) attrs.cam = null;
+           if (attrs && attrs['mic'] == null) attrs.mic = null;
+           if (attrs && attrs['width'] == null) attrs.width = 160;
+           if (attrs && attrs['height'] == null) attrs.height = 120;
+           if (attrs && attrs['playvolume'] == null) attrs.playvolume = 1.0;
+           if (attrs && attrs['url'] == null) attrs.url = "";
+           super(parent, attrs, children, instcall);
         }
     }
   ]]></script>

Modified: openlaszlo/trunk/test/video/test-camera.lzx
===================================================================
--- openlaszlo/trunk/test/video/test-camera.lzx	2009-01-09 04:11:18 UTC (rev 12372)
+++ openlaszlo/trunk/test/video/test-camera.lzx	2009-01-09 04:23:09 UTC (rev 12373)
@@ -1,5 +1,5 @@
 <!-- X_LZ_COPYRIGHT_BEGIN ************************************************
-* Copyright 2006, 2008 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2006-2009 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                       *
 * X_LZ_COPYRIGHT_END ************************************************** -->
 
@@ -36,17 +36,17 @@
             var a = 
                 gCamera.getCameraNames();
 
-            Debug.write('Camera name array: ', a, a.length);
+            //Debug.write('Camera name array: ', a, a.length);
             var n = a.length;
             var i;
             for (i = 0; i < n; i++) {
                 var cname = a[i];
-                Debug.write("Camera device index", i, "name", cname);
+                //Debug.write("Camera device index", i, "name", cname);
                 var c = 
                     new lz.camlistitem(
                         this, 
                         {text:cname, index:i});
-                Debug.write(c);
+                //Debug.write(c);
             }
           ]]>
         </handler>

Modified: openlaszlo/trunk/test/video/test-videoview.lzx
===================================================================
--- openlaszlo/trunk/test/video/test-videoview.lzx	2009-01-09 04:11:18 UTC (rev 12372)
+++ openlaszlo/trunk/test/video/test-videoview.lzx	2009-01-09 04:23:09 UTC (rev 12373)
@@ -1,5 +1,5 @@
 <!-- X_LZ_COPYRIGHT_BEGIN ************************************************
-* Copyright 2006 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2006-2009 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                       *
 * X_LZ_COPYRIGHT_END ************************************************** -->
 
@@ -12,6 +12,11 @@
         spacing="10"
     />
 
+    <text>a video stream from your camera should be displayed
+          in the rectangle below (it should be red before the
+          camera is allowed then after you click allow the 
+          video should display
+    </text>
 
     <button
         text="shrink width then height" 
@@ -51,7 +56,7 @@
         </animatorgroup>
 
 
-        <camera id="c" 
+        <camera id="c"
             show="true"
         />
 



More information about the Laszlo-checkins mailing list