PDA

View Full Version : 3.4.x - mediastream.play(start, pause)


umass89
11-16-2006, 09:31 AM
Hi,

I am looking at the new a/v components in 3.4.x and am having difficulty using the mediastream.play method with the start and pause parameters. For example I would like to show just the first frame of my video on the canvas and then start the video via an onclick event later on.

Here is my snip:

<canvas debug = "true">
<videoview height="500" width= "500" id="v" url="http://localhost:8080/lps-3.4.x/resources/20051210-w50s.flv"/>
<button x= "10" y= "150" text="play" onclick="v.stream.play(1,true)"/>
</canvas>

I have tried onclick="v.stream.play('1',true)" as well.
"v.stream.play()" will start the video but then I do not have a good way to pause it immediately.

Any ideas ? bug ?

Thanks!

curate
12-01-2006, 11:33 PM
HI
I'm not sure if thats help You,
I was made quick test in laszlo explorer and its working:

<canvas debug = "true">
<view resource="http:jfk.swf" id="v"> </view>
<button x= "10" y= "150" text="Play" onclick="v.play(1,true)"/>
<button x= "60" y= "150" text="Stop" onclick="v.stop(1,true)"/>
</canvas>

ccamelot
12-05-2006, 05:32 AM
Same here. Looks like bug. I'm digging thru sources :)

curate
12-05-2006, 05:46 AM
...url="http://localhost:8080/lps-3.4.x/resources/20051210-w50s.flv"/>
....

Laszlo did not play *.flv files, only *.swf
Or maybe i'm wrong and something new was come out?

if not , then you need to convert *.flv in to flash video *.swf format.

Regards

umass89
12-05-2006, 10:35 AM
.flv is supported with 3.4.x server release. I did a work around by incremented a counter in onidle events and then trapping and pausing the video ....:

<handler name="onidle" reference="LzIdle">
var idlecounter = getAttribute('icounter')+ 1;
setAttribute('icounter',idlecounter);
//Debug.write("idling: "+idlecounter );
if (idlecounter== '40')
{
Debug.write("video idling*********** ");
this.stream.pause();
}
</handler>