Skip to content

Commit

Permalink
improved recording quality, added more controls to test
Browse files Browse the repository at this point in the history
  • Loading branch information
ultrasaurus committed Jun 23, 2009
1 parent ed04d8c commit 6815466
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
29 changes: 27 additions & 2 deletions test-videosnap.lzx
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
<canvas>
<include href="videosnap.lzx"/>
<simplelayout spacing="4"/>

<class name="labelEdit" layout="axis:y">
<attribute name="label" value="" type="string"/>
<attribute name="text" value="" type="string"/>
<text text="${parent.label}"/>
<edittext text="${parent.text}">
<handler name="ontext">
parent.setAttribute('text', this.text);
</handler>
</edittext>
</class>


<simplelayout spacing="10"/>
<constantlayout axis="x" value="20"/>



<text><![CDATA[<videosnap id="gRecorder" x="20"/>]]></text>
<videosnap id="gRecorder" x="20"/>
<videosnap id="gRecorder" streamname="${gStreamName.text}"/>
<labelEdit id="gStreamName"
label="Stream name: (file will be called name.flv)"
text="file1"/>
<button onclick="gRecorder.setAttribute('mode', 'record')">Record Again</button>
<view>


</view>
</canvas>
10 changes: 6 additions & 4 deletions videosnap.lzx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
<attribute name="camera_height" value="300" type="number"/>

<!--- the number of frames per second for camera capture -->
<attribute name="camera_fps" value="30" type="number"/>
<attribute name="camera_fps" value="15" type="number"/>

<!--- a value (0..1) which represents the image capture quality
where 1 is the highest, set as 0 to indicate that you
want the bandwidth setting to be observed instead -->
<attribute name="camera_picturequality" value=".8" type="number"/>
<attribute name="camera_picturequality" value="1" type="number"/>

<!--- the number of bytes per second that you want the recorded
stream to be when it plays back. Set as 0 to indicate that
Expand Down Expand Up @@ -118,12 +118,14 @@

<handler name="onallowed" reference="classroot.cam">
Debug.write('onallowed', classroot.cam);
this.setVisible(true);
this.setAttribute('visible', true);
</handler>
<handler name="onclick">
if (classroot.stream.mode == "") { // need to start recording
classroot.stream.record();
} else {
Debug.write("------- stop -------");
Debug.write("stream=%w, streamname=%w",classroot.stream, classroot.streamname);
classroot.stream.stop();
classroot.setAttribute('mode', 'playback');
classroot.playVideo(classroot.streamname);
Expand All @@ -145,8 +147,8 @@
</view>
<!--- play a recorded video with the given streamname -->
<method name="playVideo" args="streamname">
Debug.write('need to write code here');
gPlayer.playVideo(streamname + '.flv', 'rtmp');
</method>

</class>
</library>

0 comments on commit 6815466

Please sign in to comment.