Thursday, March 16, 2006

What is totalframes?

The OpenLaszlo documentation for LzView defines totalframes tersely, as "The total number of frames for this view's resource."

I'm not finding that this is true for streaming audio. When the audio begins playing, totalframes starts at some smaller number (say, 1100), and continues to ramp up until it reaches a constant value (say, 5991) after a few seconds of playing. I think what's happening is that totalframes is actually/approximately the number of frames currently buffered. I'll have to experiment with longer audio files to see how well this supposition holds up.

The docs should clarify the behavior of totalframes for streaming audio, or perhaps there is a bug in LzView.totalframes...

1 Comments:

Blogger kmeixner said...

I am developing and application in OpenLaszlo and I have a movie resource defined as:

<view name="movie" resource="http:mymovie.swf" />

(where mymovie.swf is an AVI movie converted to a SWF file by Macromedia Flash 8). When I access the value movie.totalframes in my script it gives me the correct number of frames that exist in the SWF movie for this movie.

Now, my test movie is short so maybe that is why it is working. In your case it sounds like maybe it is giving you the number of frames it has currently loaded at the time you display the totalframes value.

I am also similar experiencing problems with the frame number not being set correctly when I load a SWF movie converted from AVI using the avi2swf tool included with the SWFTools package (www.swftools.org). In this case it gets set to 65535 when it should only be set to 5600). If I come up with a solution to get the correct number of frames in this case I will post it here since it might help you too.

3:33 PM  

Post a Comment

<< Home