Sarah Allen | 1 Mar 01:13
Favicon

Re: getting at the moveClip of a view; streaming flv files


As a matter of fact, I am.  It look like we need a Video object for
.attachVideo which can only be created from the Flash authoring tool (or
at least neither the flashcoders nor I know how to create using
ActionScript alone: http://pattern.junlu.com/msg/851.html )

We should be able to tweak the compiler to add in a video object wrapped
in a moveClip for runtime instantiation.  I whipped one up in Flash 
(enclosed for the curious).

Anyone know how to decompile the SWF and add the byte code into a Laszlo 
app?  I've mucked around in SWFFile.java before, but I would guess 
JGenerator doesn't have any calls for adding in the Video object.

Sarah

On Mon, Feb 27, 2006 at  5:31 PM, Don Hopkins wrote:

>> From: Sarah Allen
>> Subject: [Laszlo-dev] getting at the moveClip of a view
>>
>> So, I wanted to get at the movieClip of a view (prototyping something 
>> before actually diving into the LFC), and I couldn't figure it out. I 
>> swear I've done this before. [...]
>
> Are you trying to do the same thing I want to do? I've been noodling 
> around
> with trying to get Laszlo to play streaming flv files, but so far have 
> only
> been able to get their audio streams to play, without any video 
(Continue reading)

Henry Minsky | 1 Mar 01:37
Picon

Re: getting at the moveClip of a view; streaming flv files

I can try to help out adding a new object to JGenerator. Do you have the tag opcode and parameters it needs?


On 2/28/06, Sarah Allen < sallen <at> laszlosystems.com> wrote:

As a matter of fact, I am.  It look like we need a Video object for
.attachVideo which can only be created from the Flash authoring tool (or
at least neither the flashcoders nor I know how to create using
ActionScript alone: http://pattern.junlu.com/msg/851.html )

We should be able to tweak the compiler to add in a video object wrapped
in a moveClip for runtime instantiation.  I whipped one up in Flash
(enclosed for the curious).

Anyone know how to decompile the SWF and add the byte code into a Laszlo
app?  I've mucked around in SWFFile.java before, but I would guess
JGenerator doesn't have any calls for adding in the Video object.

Sarah


On Mon, Feb 27, 2006 at  5:31 PM, Don Hopkins wrote:

>> From: Sarah Allen
>> Subject: [Laszlo-dev] getting at the moveClip of a view
>>
>> So, I wanted to get at the movieClip of a view (prototyping something
>> before actually diving into the LFC), and I couldn't figure it out. I
>> swear I've done this before. [...]
>
> Are you trying to do the same thing I want to do? I've been noodling
> around
> with trying to get Laszlo to play streaming flv files, but so far have
> only
> been able to get their audio streams to play, without any video
> displayed.
>
> I think the reason you're not finding an __LZmovieClipRef is that
> they're
> only created under certain circumstances, like the view having a
> resource or
> background color, or containing other views. There's a method called
> makeContainerResource that seems to make a __LZmovieClipRef, which I
> think
> gets called when you dynamically set the resource or add sub-views.
> Setting
> the background color of a view also creates its __LZmovieClipRef.
> Here's a snippet from my latest attempt, for a top secret "SimCheney"
> project I'm working on, big time. Don't leak the source or I'll blast
> you in
> the face with a shotgun! (No actually, feel free to leak the source!
> Just
> please let me know if you get it to work!)
> It just plays the audio from the flv, but doesn't show the video. The
> resource="gofuckyourself_res" causes the __LZmovieClipRef to be
> defined,
> otherwise it's undefined, which causes warnings, but the audio plays
> anyway
> for some reason.
>       -Don
>
>
>     <view name="movieplayer" id="gMP"
>       x="${canvas.leftEdge}"
>       y="${canvas.topEdge}"
>       width="${parent.width - ( canvas.leftEdge + canvas.rightEdge)}"
>       height="${parent.height - (canvas.topEdge + canvas.bottomEdge)}"
>       stretches="both"
>       resource="gofuckyourself_res"
>>
>
>       <attribute name="connection" value="null"/>
>       <attribute name="stream" value="null"/>
>
>       <method event="oninit"><![CDATA[
>           var ref = this.__LZmovieClipRef;
>           Debug.write("oninit", this, this.__LZmovieClipRef);
>           this.connection = new NetConnection();
>           Debug.write("connection", connection);
>           this.connection.connect(null);
>           this.stream = new NetStream(this.connection);
>           Debug.write("stream", stream);
>           this.stream.onStatus = function(info) {
>             Debug.write("status", this, info, info.level, info.code);
>           }
>           ref.attachVideo(this.stream);
>           this.stream.setBufferTime(5);
>           this.stream.play("MaherCheney.flv");                  ]]>
>       </method>
>
>     </view>
>
> Here's the debugger output (I also clicked on the interesting objects
> to
> show them, with "Debug.showInternalProperties = true" of course):
>
> oninit #gMP<MovieClip#1| _level0.$m0.$m0.$m0> connection <object#2|
> {contentType: application/x-fcs}> stream <object#3| {}> status
> <object#3| {}>{level: status, code: NetStream.Play.Start} status
> NetStream.Play.Start status <object#3| {}>{level: status, code:
> NetStream.Buffer.Full} status
> NetStream.Buffer.Full status <object#3| {}>{level: status, code:
> NetStream.Buffer.Flush} status
> NetStream.Buffer.Flush status <object#3| {}>{level: status, code:
> NetStream.Buffer.Flush} status
> NetStream.Buffer.Flush status <object#3| {}>{level: status, code:
> NetStream.Play.Stop} status
> NetStream.Play.Stop status <object#3| {}>{level: status, code:
> NetStream.Buffer.Empty} status
> NetStream.Buffer.Empty <MovieClip#1| _level0.$m0.$m0.$m0> { __proto__:
> <Object#10| MovieClip.prototype>   _currentframe: 1 _opacity:
> <undefined>   _rotation: 0   _visible: true   _x: 40 _xscale: 1102
> _y: 40   _yscale: 874   constructor: MovieClip } <MovieClip#1|
> _level0.$m0.$m0.$m0> <object#2| {contentType: application/x-fcs}> {
> __constructor__: <Function#12>   __proto__: <Object#13|
> undefined#12.prototype>   contentType: application/x-fcs isConnected:
> true   uri: null } <undefined#12#12#2| {contentType:
> application/x-fcs}> <object#3| {}> {   __constructor__: <Function#14>
> __proto__: <Object#15| undefined#14.prototype>   _bytesTotal: 2949922
> audiocodec: 2   bufferLength: 0   bufferTime: 5   bytesLoaded: 2949922
> bytesTotal: 2949922   currentFps: 0   decodedFrames: 0   liveDelay: 0
> onStatus: <Function#16| this.stream.onStatus>   time: 49.52
> videocodec: 0 } <undefined#14#14#3| {}>
>
>
> -----Original Message-----
> From: laszlo-dev-bounces <at> openlaszlo.org
> [mailto: laszlo-dev-bounces <at> openlaszlo.org] On Behalf Of Sarah Allen
> Sent: Monday, February 27, 2006 12:46 PM
> To: OpenLaszlo development development
> Subject: [Laszlo-dev] getting at the moveClip of a view
>
>
> So, I wanted to get at the movieClip of a view (prototyping something
> before actually diving into the LFC), and I couldn't figure it out.  I
> swear I've done this before.
>
> Simple test case:
> <canvas>
>    <view id="v" oninit="Debug.write(this.__LZmovieClipRef)"/>
> </canvas>
>
> shows in the debugger:
> WARNING: test.lzx:2: reference to undefined property
> '__LZmovieClipRef'
> <undefined>
>
> Adding width, height and bgcolor to the view didn't help.  If I set
> Debug.showInternalProperties = true, I see __LZbgRef:, but no
> __LZmovieClipRef
>
> What's up?
>
> Thanks,
> Sarah
>
>


_______________________________________________
Laszlo-dev mailing list
Laszlo-dev <at> openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev






--
Henry Minsky
Software Architect
hminsky <at> laszlosystems.com

_______________________________________________
Laszlo-dev mailing list
Laszlo-dev <at> openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
Sarah Allen | 1 Mar 01:47
Favicon

Re: getting at the moveClip of a view; streaming flv files

Didn't we have some tools that would decode SWF files?  The SWF I sent earlier should have the opcodes in it.  I exported as SWF6.


On Tue, Feb 28, 2006 at  4:37 PM, Henry Minsky wrote:

I can try to help out adding a new object to JGenerator. Do you have the tag opcode and parameters it needs?


On 2/28/06, Sarah Allen < sallen <at> laszlosystems.com> wrote:
As a matter of fact, I am.  It look like we need a Video object for
.attachVideo which can only be created from the Flash authoring tool (or
at least neither the flashcoders nor I know how to create using

We should be able to tweak the compiler to add in a video object wrapped
in a moveClip for runtime instantiation.  I whipped one up in Flash
(enclosed for the curious).

Anyone know how to decompile the SWF and add the byte code into a Laszlo
app?  I've mucked around in SWFFile.java before, but I would guess
JGenerator doesn't have any calls for adding in the Video object.

Sarah


On Mon, Feb 27, 2006 at  5:31 PM, Don Hopkins wrote:

>> From: Sarah Allen
>> Subject: [Laszlo-dev] getting at the moveClip of a view
>>
>> So, I wanted to get at the movieClip of a view (prototyping something
>> before actually diving into the LFC), and I couldn't figure it out. I
>> swear I've done this before. [...]
>
> Are you trying to do the same thing I want to do? I've been noodling
> around
> with trying to get Laszlo to play streaming flv files, but so far have
> only
> been able to get their audio streams to play, without any video
> displayed.
>
> I think the reason you're not finding an __LZmovieClipRef is that
> they're
> only created under certain circumstances, like the view having a
> resource or
> background color, or containing other views. There's a method called
> makeContainerResource that seems to make a __LZmovieClipRef, which I
> think
> gets called when you dynamically set the resource or add sub-views.
> Setting
> the background color of a view also creates its __LZmovieClipRef.
> Here's a snippet from my latest attempt, for a top secret "SimCheney"
> project I'm working on, big time. Don't leak the source or I'll blast
> you in
> the face with a shotgun! (No actually, feel free to leak the source!
> Just
> please let me know if you get it to work!)
> It just plays the audio from the flv, but doesn't show the video. The
> resource="gofuckyourself_res" causes the __LZmovieClipRef to be
> defined,
> otherwise it's undefined, which causes warnings, but the audio plays
> anyway
> for some reason.
>       -Don
>
>
>     <view name="movieplayer" id="gMP"
>       x="${canvas.leftEdge}"
>       y="${canvas.topEdge}"
>       width="${parent.width - ( canvas.leftEdge + canvas.rightEdge)}"
>       height="${parent.height - (canvas.topEdge + canvas.bottomEdge)}"
>       stretches="both"
>       resource="gofuckyourself_res"
>>
>
>       <attribute name="connection" value="null"/>
>       <attribute name="stream" value="null"/>
>
>       <method event="oninit"><![CDATA[
>           var ref = this.__LZmovieClipRef;
>           Debug.write("oninit", this, this.__LZmovieClipRef);
>           this.connection = new NetConnection();
>           Debug.write("connection", connection);
>           this.connection.connect(null);
>           this.stream = new NetStream(this.connection);
>           Debug.write("stream", stream);
>           this.stream.onStatus = function(info) {
>             Debug.write("status", this, info, info.level, info.code);
>           }
>           ref.attachVideo(this.stream);
>           this.stream.setBufferTime(5);
>            this.stream.play("MaherCheney.flv");                  ]]>
>       </method>
>
>     </view>
>
> Here's the debugger output (I also clicked on the interesting objects
> to
> show them, with "Debug.showInternalProperties = true" of course):
>
> oninit #gMP<MovieClip#1| _level0.$m0.$m0.$m0> connection <object#2|
> {contentType: application/x-fcs}> stream <object#3| {}> status
> <object#3| {}>{level: status, code: NetStream.Play.Start} status
> NetStream.Play.Start status <object#3| {}>{level: status, code:
> NetStream.Buffer.Full} status
> NetStream.Buffer.Full  status <object#3| {}>{level: status, code:
> NetStream.Buffer.Flush} status
> NetStream.Buffer.Flush status <object#3| {}>{level: status, code:
> NetStream.Buffer.Flush} status
> NetStream.Buffer.Flush  status <object#3| {}>{level: status, code:
> NetStream.Play.Stop} status
> NetStream.Play.Stop status <object#3| {}>{level: status, code:
> NetStream.Buffer.Empty} status
> NetStream.Buffer.Empty  <MovieClip#1| _level0.$m0.$m0.$m0> { __proto__:
> <Object#10| MovieClip.prototype>   _currentframe: 1 _opacity:
> <undefined>   _rotation: 0   _visible: true   _x: 40 _xscale: 1102
> _y: 40   _yscale: 874   constructor: MovieClip } <MovieClip#1|
> _level0.$m0.$m0.$m0> <object#2| {contentType: application/x-fcs}> {
> __constructor__: <Function#12>   __proto__: <Object#13|
> undefined#12.prototype>   contentType: application/x-fcs isConnected:
> true   uri: null } <undefined#12#12#2| {contentType:
> application/x-fcs}> <object#3| {}> {   __constructor__: <Function#14>
> __proto__: <Object#15| undefined#14.prototype>   _bytesTotal: 2949922
> audiocodec: 2   bufferLength: 0   bufferTime: 5   bytesLoaded: 2949922
> bytesTotal: 2949922   currentFps: 0   decodedFrames: 0   liveDelay: 0
> onStatus: <Function#16| this.stream.onStatus>   time:  49.52
> videocodec: 0 } <undefined#14#14#3| {}>
>
>
> -----Original Message-----
> [mailto: laszlo-dev-bounces <at> openlaszlo.org] On Behalf Of Sarah Allen
> Sent: Monday, February 27, 2006 12:46 PM
> To: OpenLaszlo development development
> Subject: [Laszlo-dev] getting at the moveClip of a view
>
>
> So, I wanted to get at the movieClip of a view (prototyping something
> before actually diving into the LFC), and I couldn't figure it out.  I
> swear I've done this before.
>
> Simple test case:
> <canvas>
>    <view id="v" oninit="Debug.write(this.__LZmovieClipRef)"/>
> </canvas>
>
> shows in the debugger:
> WARNING:  test.lzx:2: reference to undefined property
> '__LZmovieClipRef'
> <undefined>
>
> Adding width, height and bgcolor to the view didn't help.  If I set
> Debug.showInternalProperties = true, I see __LZbgRef:, but no
> __LZmovieClipRef
>
> What's up?
>
> Thanks,
> Sarah
>
>


_______________________________________________
Laszlo-dev mailing list






--
Henry Minsky
Software Architect

_______________________________________________
Laszlo-dev mailing list
Laszlo-dev <at> openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
Sarah Allen | 1 Mar 02:24
Favicon

Re: getting at the moveClip of a view; streaming flv files

oops.  The file I sent earlier didn't actually have the library object
in it.  Apparently I needed to place it on the stage for it to be
included in the movie.

I compiled swfdump and got the following output (from the enclosed SWF).
I included the hex output, if that helps:
[HEADER]        File version: 6
[HEADER]        File size: 86
[HEADER]        Frame rate: 12.000000
[HEADER]        Frame count: 1
[HEADER]        Movie width: 550.00
[HEADER]        Movie height: 400.00
[009]         3 SETBACKGROUNDCOLOR (ff/ff/ff)
                  -=> ff ff ff
ÿÿÿ
[03c]        10 DEFINEVIDEOSTREAM defines id 0001 (0 frames, 160x120
codec 0x00)

                  -=> 01 00 00 00 a0 00 78 00 00 00
.... .x.
..
[027]         4 DEFINESPRITE defines id 0002
                           -=> 02 00 01 00
   ....
[01a]         7          PLACEOBJECT2 places id 0001 at depth 0001
                            | Matrix
                            | 1.000 0.000   0.35
                            | 0.000 1.000   0.00
                           -=> 06 01 00 01 00 08 e0
   ......à
[001]         0          SHOWFRAME 0 (00:00:00,000)
[000]         0          END
[01a]        11 PLACEOBJECT2 places id 0002 at depth 0001 name "_vc"
                   | Matrix
                   | 1.000 0.000  -0.35
                   | 0.000 1.000   0.00
                  -=> 26 01 00 02 00 09 20 5f 76 63 00
&..... _
vc.
[001]         0 SHOWFRAME 0 (00:00:00,000)
[000]         0 END

On Tue, Feb 28, 2006 at  4:47 PM, Sarah Allen wrote:

Didn't we have some tools that would decode SWF files?  The SWF I sent
earlier should have the opcodes in it.  I exported as SWF6.

On Tue, Feb 28, 2006 at  4:37 PM, Henry Minsky wrote:

I can try to help out adding a new object to JGenerator. Do you have the
tag opcode and parameters it needs?

On 2/28/06, Sarah Allen < sallen <at> laszlosystems.com
<javascript:lzSetCanvasAttribute('js_mailto',
'sallen <at> laszlosystems.com')> > wrote:
As a matter of fact, I am.  It look like we need a Video object for
.attachVideo which can only be created from the Flash authoring tool (or
at least neither the flashcoders nor I know how to create using
ActionScript alone: http://pattern.junlu.com/msg/851.html)

We should be able to tweak the compiler to add in a video object wrapped
in a moveClip for runtime instantiation.  I whipped one up in Flash
(enclosed for the curious).

Anyone know how to decompile the SWF and add the byte code into a Laszlo
app?  I've mucked around in SWFFile.java before, but I would guess
JGenerator doesn't have any calls for adding in the Video object.

Sarah

On Mon, Feb 27, 2006 at  5:31 PM, Don Hopkins wrote:

>> From: Sarah Allen Subject: [Laszlo-dev] getting at the moveClip of a 
>> view
>> So, I wanted to get at the movieClip of a view (prototyping something 
>> before actually diving into the LFC), and I couldn't figure it out. I 
>> swear I've done this before. [...]
>
> Are you trying to do the same thing I want to do? I've been noodling 
> around with trying to get Laszlo to play streaming flv files, but so 
> far have only been able to get their audio streams to play, without 
> any video displayed.
> I think the reason you're not finding an __LZmovieClipRef is that 
> they're only created under certain circumstances, like the view having 
> a resource or background color, or containing other views. There's a 
> method called makeContainerResource that seems to make a 
> __LZmovieClipRef, which I think gets called when you dynamically set 
> the resource or add sub-views. Setting the background color of a view 
> also creates its __LZmovieClipRef. Here's a snippet from my latest 
> attempt, for a top secret "SimCheney" project I'm working on, big 
> time. Don't leak the source or I'll blast you in the face with a 
> shotgun! (No actually, feel free to leak the source! Just please let 
> me know if you get it to work!) It just plays the audio from the flv, 
> but doesn't show the video. The resource="gofuckyourself_res" causes 
> the __LZmovieClipRef to be defined, otherwise it's undefined, which 
> causes warnings, but the audio plays anyway for some reason. -Don
>
>     <view name="movieplayer" id="gMP"       x="${canvas.leftEdge}" 
> y="${canvas.topEdge}"       width="${parent.width - ( canvas.leftEdge 
> + canvas.rightEdge)}"       height="${parent.height - (canvas.topEdge 
> + canvas.bottomEdge)}"       stretches="both" 
> resource="gofuckyourself_res"
>>
>
>       <attribute name="connection" value="null"/>       <attribute 
> name="stream" value="null"/>
>       <method event="oninit"><![CDATA[           var ref = 
> this.__LZmovieClipRef;           Debug.write("oninit", this, 
> this.__LZmovieClipRef);           this.connection = new 
> NetConnection();           Debug.write("connection", connection); 
> this.connection.connect(null);           this.stream = new 
> NetStream(this.connection);           Debug.write("stream", stream); 
> this.stream.onStatus = function(info) { Debug.write("status", this, 
> info, info.level, info.code);           } 
> ref.attachVideo(this.stream);           this.stream.setBufferTime(5); 
> this.stream.play("MaherCheney.flv");                  ]]> </method>
>     </view>
> Here's the debugger output (I also clicked on the interesting objects 
> to show them, with "Debug.showInternalProperties = true" of course):
> oninit #gMP<MovieClip#1| _level0.$m0.$m0.$m0> connection <object#2| 
> {contentType: application/x-fcs}> stream <object#3| {}> status 
> <object#3| {}>{level: status, code: NetStream.Play.Start} status 
> NetStream.Play.Start status <object#3| {}>{level: status, code: 
> NetStream.Buffer.Full} status NetStream.Buffer.Full  status <object#3| 
> {}>{level: status, code: NetStream.Buffer.Flush} status 
> NetStream.Buffer.Flush status <object#3| {}>{level: status, code: 
> NetStream.Buffer.Flush} status NetStream.Buffer.Flush  status 
> <object#3| {}>{level: status, code: NetStream.Play.Stop} status 
> NetStream.Play.Stop status <object#3| {}>{level: status, code: 
> NetStream.Buffer.Empty} status NetStream.Buffer.Empty  <MovieClip#1| 
> _level0.$m0.$m0.$m0> { __proto__: <Object#10| MovieClip.prototype> 
> _currentframe: 1 _opacity: <undefined>   _rotation: 0   _visible: true 
> _x: 40 _xscale: 1102 _y: 40   _yscale: 874   constructor: MovieClip } 
> <MovieClip#1| _level0.$m0.$m0.$m0> <object#2| {contentType: 
> application/x-fcs}> { __constructor__: <Function#12>   __proto__: 
> <Object#13| undefined#12.prototype>   contentType: application/x-fcs 
> isConnected: true   uri: null } <undefined#12#12#2| {contentType: 
> application/x-fcs}> <object#3| {}> {   __constructor__: <Function#14> 
> __proto__: <Object#15| undefined#14.prototype>   _bytesTotal: 2949922 
> audiocodec: 2   bufferLength: 0   bufferTime: 5   bytesLoaded: 2949922 
> bytesTotal: 2949922   currentFps: 0   decodedFrames: 0   liveDelay: 0 
> onStatus: <Function#16| this.stream.onStatus>   time:  49.52 
> videocodec: 0 } <undefined#14#14#3| {}>
>
> -----Original Message----- From: laszlo-dev-bounces <at> openlaszlo.org 
> <javascript:lzSetCanvasAttribute('js_mailto', 
> 'laszlo-dev-bounces <at> openlaszlo.org')> [mailto: 
> laszlo-dev-bounces <at> openlaszlo.org 
> <javascript:lzSetCanvasAttribute('js_mailto', 
> 'laszlo-dev-bounces <at> openlaszlo.org')> ] On Behalf Of Sarah Allen Sent: 
> Monday, February 27, 2006 12:46 PM To: OpenLaszlo development 
> development Subject: [Laszlo-dev] getting at the moveClip of a view
>
> So, I wanted to get at the movieClip of a view (prototyping something 
> before actually diving into the LFC), and I couldn't figure it out.  I 
> swear I've done this before.
> Simple test case: <canvas>    <view id="v" 
> oninit="Debug.write(this.__LZmovieClipRef)"/> </canvas>
> shows in the debugger: WARNING:  test.lzx:2: reference to undefined 
> property '__LZmovieClipRef' <undefined>
> Adding width, height and bgcolor to the view didn't help.  If I set 
> Debug.showInternalProperties = true, I see __LZbgRef:, but no 
> __LZmovieClipRef
> What's up?
> Thanks, Sarah
>

_______________________________________________
Laszlo-dev mailing list
Laszlo-dev <at> openlaszlo.org <javascript:lzSetCanvasAttribute('js_mailto',
'Laszlo-dev <at> openlaszlo.org')>
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

<http://www.openlaszlo.org/mailman/listinfo/laszlo-dev>

-- 
Henry Minsky
Software Architect
hminsky <at> laszlosystems.com <javascript:lzSetCanvasAttribute('js_mailto',
'hminsky <at> laszlosystems.com')>

------------------------------

_______________________________________________
Laszlo-dev mailing list
Laszlo-dev <at> openlaszlo.org 
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev 
Attachment (video-on-stage.swf): application/x-shockwave-flash, 86 bytes
_______________________________________________
Laszlo-dev mailing list
Laszlo-dev <at> openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
Cortlandt Winters | 1 Mar 03:09
Picon

Re: getting at the moveClip of a view; streaming flv files

Hi Folk,

I was noodling around with this as well.

I was hoping to see if i could get a red5 stream working with laszlo. That group has made a lot of progress in the past 4 months or so and may prove to be a great resource to look at. They are at the osflash site if you are interested.

What I was looking into was adding flv to the list of mime types accepted in the media transcoder so we can access it as a resource and attach it from the library. The reason is that video streams are attached, rather than loaded so it seems like they will need to be in the symbol library. Swf video might be a bit easier though.

Most of the transcoder calls seem to just pass the data on prepended with a magic number. I think swf video may not be that difficult to add but has more data that it needs based on the swf. Flv seems straightforward as well and is described in detail, but may take more work as the file format has lots of parameters that it uses.

The swf DefineVideoStream tag type is 60, it defines a video character so it can be put on the display list.The other fields (16bit) are the id for the video character, the number of videoframe tags that make up the stream, the width and height, then there are 5 reserved bits, a 2bit deblocking flag, (which affects rendering) of 01 off 10 on and a one bit smoothing flag of 0 off and 1 on, finally there is an 8bit codecID which is 2 for sorenson h263 or 3 for screen video (which is for screen captures like breeze uses).

The VideoFrame tag type is 61 and has the fields id(16bit), framenumber(16bits) and the videodata

I think the flv files are even more intersting than swf video, but just getting to be able to display video would be awesome.

Hope this is helpfull.

-Cort

On a side note, for experimenting, here's a post by Robin Debreuil from a few years ago on an easy way to inject data into a swf.
http://blog.debreuil.com/archive/2003/10/15/150.aspx


On 2/28/06, Sarah Allen < sallen <at> laszlosystems.com> wrote:

As a matter of fact, I am.  It look like we need a Video object for
.attachVideo which can only be created from the Flash authoring tool (or
at least neither the flashcoders nor I know how to create using
ActionScript alone: http://pattern.junlu.com/msg/851.html )

We should be able to tweak the compiler to add in a video object wrapped
in a moveClip for runtime instantiation.  I whipped one up in Flash
(enclosed for the curious).

Anyone know how to decompile the SWF and add the byte code into a Laszlo
app?  I've mucked around in SWFFile.java before, but I would guess
JGenerator doesn't have any calls for adding in the Video object.

Sarah


On Mon, Feb 27, 2006 at  5:31 PM, Don Hopkins wrote:

>> From: Sarah Allen
>> Subject: [Laszlo-dev] getting at the moveClip of a view
>>
>> So, I wanted to get at the movieClip of a view (prototyping something
>> before actually diving into the LFC), and I couldn't figure it out. I
>> swear I've done this before. [...]
>
> Are you trying to do the same thing I want to do? I've been noodling
> around
> with trying to get Laszlo to play streaming flv files, but so far have
> only
> been able to get their audio streams to play, without any video
> displayed.
>
> I think the reason you're not finding an __LZmovieClipRef is that
> they're
> only created under certain circumstances, like the view having a
> resource or
> background color, or containing other views. There's a method called
> makeContainerResource that seems to make a __LZmovieClipRef, which I
> think
> gets called when you dynamically set the resource or add sub-views.
> Setting
> the background color of a view also creates its __LZmovieClipRef.
> Here's a snippet from my latest attempt, for a top secret "SimCheney"
> project I'm working on, big time. Don't leak the source or I'll blast
> you in
> the face with a shotgun! (No actually, feel free to leak the source!
> Just
> please let me know if you get it to work!)
> It just plays the audio from the flv, but doesn't show the video. The
> resource="gofuckyourself_res" causes the __LZmovieClipRef to be
> defined,
> otherwise it's undefined, which causes warnings, but the audio plays
> anyway
> for some reason.
>       -Don
>
>
>     <view name="movieplayer" id="gMP"
>       x="${canvas.leftEdge}"
>       y="${canvas.topEdge }"
>       width="${parent.width - (canvas.leftEdge + canvas.rightEdge)}"
>       height="${parent.height - (canvas.topEdge + canvas.bottomEdge)}"
>       stretches="both"
>       resource="gofuckyourself_res"
>>
>
>       <attribute name="connection" value="null"/>
>       <attribute name="stream" value="null"/>
>
>       <method event="oninit"><![CDATA[
>           var ref = this.__LZmovieClipRef;
>           Debug.write("oninit", this, this.__LZmovieClipRef);
>           this.connection = new NetConnection();
>           Debug.write("connection", connection);
>           this.connection.connect(null);
>           this.stream = new NetStream(this.connection);
>           Debug.write("stream", stream);
>           this.stream.onStatus = function(info) {
>             Debug.write("status", this, info, info.level, info.code);
>           }
>           ref.attachVideo(this.stream);
>           this.stream.setBufferTime(5);
>           this.stream.play("MaherCheney.flv");                  ]]>
>       </method>
>
>     </view>
>
> Here's the debugger output (I also clicked on the interesting objects
> to
> show them, with "Debug.showInternalProperties = true" of course):
>
> oninit #gMP<MovieClip#1| _level0.$m0.$m0.$m0> connection <object#2|
> {contentType: application/x-fcs}> stream <object#3| {}> status
> <object#3| {}>{level: status, code: NetStream.Play.Start} status
> NetStream.Play.Start status <object#3| {}>{level: status, code:
> NetStream.Buffer.Full} status
> NetStream.Buffer.Full status <object#3| {}>{level: status, code:
> NetStream.Buffer.Flush} status
> NetStream.Buffer.Flush status <object#3| {}>{level: status, code:
> NetStream.Buffer.Flush} status
> NetStream.Buffer.Flush status <object#3| {}>{level: status, code:
> NetStream.Play.Stop} status
> NetStream.Play.Stop status <object#3| {}>{level: status, code:
> NetStream.Buffer.Empty} status
> NetStream.Buffer.Empty <MovieClip#1| _level0.$m0.$m0.$m0> { __proto__:
> <Object#10| MovieClip.prototype>   _currentframe: 1 _opacity:
> <undefined>   _rotation: 0   _visible: true   _x: 40 _xscale: 1102
> _y: 40   _yscale: 874   constructor: MovieClip } <MovieClip#1|
> _level0.$m0.$m0.$m0> <object#2| {contentType: application/x-fcs}> {
> __constructor__: <Function#12>   __proto__: <Object#13|
> undefined#12.prototype>   contentType: application/x-fcs isConnected:
> true   uri: null } <undefined#12#12#2| {contentType:
> application/x-fcs}> <object#3| {}> {   __constructor__: <Function#14>
> __proto__: <Object#15| undefined#14.prototype>   _bytesTotal: 2949922
> audiocodec: 2   bufferLength: 0   bufferTime: 5   bytesLoaded: 2949922
> bytesTotal: 2949922   currentFps: 0   decodedFrames: 0   liveDelay: 0
> onStatus: <Function#16| this.stream.onStatus>   time: 49.52
> videocodec: 0 } <undefined#14#14#3| {}>
>
>
> -----Original Message-----
> From: laszlo-dev-bounces <at> openlaszlo.org
> [mailto:laszlo-dev-bounces <at> openlaszlo.org] On Behalf Of Sarah Allen
> Sent: Monday, February 27, 2006 12:46 PM
> To: OpenLaszlo development development
> Subject: [Laszlo-dev] getting at the moveClip of a view
>
>
> So, I wanted to get at the movieClip of a view (prototyping something
> before actually diving into the LFC), and I couldn't figure it out.  I
> swear I've done this before.
>
> Simple test case:
> <canvas>
>    <view id="v" oninit="Debug.write(this.__LZmovieClipRef)"/>
> </canvas>
>
> shows in the debugger:
> WARNING: test.lzx:2: reference to undefined property
> '__LZmovieClipRef'
> <undefined>
>
> Adding width, height and bgcolor to the view didn't help.  If I set
> Debug.showInternalProperties = true, I see __LZbgRef:, but no
> __LZmovieClipRef
>
> What's up?
>
> Thanks,
> Sarah
>
>


_______________________________________________
Laszlo-dev mailing list
Laszlo-dev <at> openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev




_______________________________________________
Laszlo-dev mailing list
Laszlo-dev <at> openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
Cortlandt Winters | 1 Mar 03:28
Picon

Re: getting at the moveClip of a view; streaming flv files

ps those bits are all unsigned

_______________________________________________
Laszlo-dev mailing list
Laszlo-dev <at> openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
Cortlandt Winters | 1 Mar 04:56
Picon

Re: getting at the moveClip of a view; streaming flv files

Hi Don,

Your success with this has made me try and figure this out some more.

One thing that is mentioned in the swf file format spec is that the frame rate of a flash video stream
is dependent on the swf frame rate.That stands out to me as the currentFps below is 0.

Apparently how it works is that when the player starts playing a frame the video images from any videoframe tags in that fram are rendered. Timing info from the flv file itself is ignored.

It would be interesting to see where the 0fps came from and if we can change it.


I wonder if this video codec

On 2/27/06, Don Hopkins < dhopkins <at> donhopkins.com> wrote:

  __constructor__: <Function#14>
  __proto__: <Object#15| undefined#14.prototype>
  _bytesTotal: 2949922
  audiocodec: 2
  bufferLength: 0
  bufferTime: 5
  bytesLoaded: 2949922
  bytesTotal: 2949922
  currentFps: 0
  decodedFrames: 0
  liveDelay: 0
  onStatus: <Function#16| this.stream.onStatus>
  time: 49.52
  videocodec: 0
}
<undefined#14#14#3| {}>
_______________________________________________
Laszlo-dev mailing list
Laszlo-dev <at> openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
Michael Pliskin | 1 Mar 10:00
Picon

Russian Laszlo community site

Hello all,

  I have a question for OpenLaszlo people. I'd like to start a Russian
  Laszlo community site & user group. The basic ideas behind are:
   - make Laszlo more popular among russian users
   - provide at least some basic Laszlo documentation and articles in
     Russian
   - build some kind of Russian Laszlo user community

  So I am asking for your opinion about the idea and also for
  permission to use a domain name like openlaszlo.ru for it.

--

-- 
Best regards,
 Michael                          mailto:pl <at> tepkom.ru
Don Hopkins | 1 Mar 10:12

Re: getting at the moveClip of a view; streaming flv files

I’d sure love to get this working – thanks for all the help!

 

Oddly enough, it plays the movie’s sound just fine… But nothing renders on the screen.

I took that debugger snapshot of the video object after the sound had finished playing, so it may be that it reset the currentFps after it finished playing, so it might not be meaningful.

If this boils down to needing a special kind of video object that requires a magic byte code unsupported by OpenLaszlo, then maybe there’s a way to import the swf file Sarah provided to trick it into creating the video object, by attaching the resource to a view and grabbing the video object out of it.

I don’t know enough about how the Flash player works to be sure, so that’s just a shot in the dark.

 

I will try a few experiments with the video-on-stage.swf loading into an openlaszlo app, and see if I can find a reference to the magic object that works with ref.attachVideo(netstream).

I tried going:

 

  <resource name="res_video" src="swf/video-on-stage.swf"/> 

But I got the warning:

 SimCheney.lzx:15:60: Can't import \swf\video-on-stage.swf: 1 >= 0

 

That’s weird!

Could this be a version number problem. I will admit that 1 >= 0 (on a good day), but as to what that means, I’m mystified.

Here is what swfdump makes of it:

 

$ swfdump video-on-stage.swf

[HEADER]        File version: 6

[HEADER]        File size: 86

[HEADER]        Frame rate: 12.000000

[HEADER]        Frame count: 1

[HEADER]        Movie width: 550.00

[HEADER]        Movie height: 400.00

[009]         3 SETBACKGROUNDCOLOR (ff/ff/ff)

[03c]        10 DEFINEVIDEOSTREAM defines id 0001 (0 frames, 160x120 codec 0x00)

[027]         4 DEFINESPRITE defines id 0002

[01a]         7          PLACEOBJECT2 places id 0001 at depth 0001

[001]         0          SHOWFRAME 0 (00:00:00,000)

[000]         0          END

[01a]        11 PLACEOBJECT2 places id 0002 at depth 0001 name "_vc"

[001]         0 SHOWFRAME 0 (00:00:00,000)

[000]         0 END

 

            -Don

 

 

-----Original Message-----
From: Cortlandt Winters [mailto:cortrah <at> gmail.com]
Sent: Tuesday, February 28, 2006 7:57 PM
To: Don Hopkins
Cc: sallen <at> laszlosystems.com; OpenLaszlo development development
Subject: Re: [Laszlo-dev] getting at the moveClip of a view; streaming flv files

 

Hi Don,

Your success with this has made me try and figure this out some more.

One thing that is mentioned in the swf file format spec is that the frame rate of a flash video stream
is dependent on the swf frame rate.That stands out to me as the currentFps below is 0.

Apparently how it works is that when the player starts playing a frame the video images from any videoframe tags in that fram are rendered. Timing info from the flv file itself is ignored.

It would be interesting to see where the 0fps came from and if we can change it.


I wonder if this video codec

On 2/27/06, Don Hopkins < dhopkins <at> donhopkins.com> wrote:


  __constructor__: <Function#14>
  __proto__: <Object#15| undefined#14.prototype>
  _bytesTotal: 2949922
  audiocodec: 2
  bufferLength: 0
  bufferTime: 5
  bytesLoaded: 2949922
  bytesTotal: 2949922
  currentFps: 0
  decodedFrames: 0
  liveDelay: 0
  onStatus: <Function#16| this.stream.onStatus>
  time: 49.52
  videocodec: 0
}
<undefined#14#14#3| {}>

_______________________________________________
Laszlo-dev mailing list
Laszlo-dev <at> openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
Don Hopkins | 1 Mar 12:56

Re: getting at the moveClip of a view; streaming flv files

I googled around for the error message, and found that “1 >= 0” means that the lzx compiler expects Flash version 5, but that version does not support the video objects. Rats.

 

http://www.laszlosystems.com/developers/community/forums/showthread.php?threadid=2157

 

Here’s some interesting stuff about using swfmill to make a video object:

 

http://lists.motion-twin.com/pipermail/mtasc/2005-May/014573.html

 

Here is the documentation for the instruction we need:

 

http://sswf.sourceforge.net/SWFalexref.html#tag_definevideostream

 

This tag defines a video stream. To playback the video stream, one needs to add a list of VideoFrame tags.

  struct swf_definevideostream {         swf_tag                f_tag;         /* 60 */         unsigned short         f_id;         unsigned short         f_frame_count;         unsigned short         f_width;       /* WARNING: this is in pixels */         unsigned short         f_height;         unsigned char          f_reserved : 5;         unsigned char          f_deblocking : 2;         unsigned char          f_smoothing : 1;         unsigned char          f_codec;  };

The f_width and f_height are defined in pixels. This is rather uncommon in SWF so it is to be noted multiple times.

The f_deblocking parameter can be set to 0 (use the video packet information); 1 (always off) or 2 (always on). All videos are saved in small blocks of about 32x32 pixels (there are different sizes.) Turning this feature on lets the player mix colors between blocks for better output quality.

The f_smoothing flag can be set to 1 to have the player smooth the video before to render it on the output screen.

The f_codec number specifies which codec was used to compress the video. At this time, the following are defined:

Number

Name

Comments

SWF Version

2

Sorenson H.263

 

6

3

Screen Video

 

7

 

 

This is what the swfmill xml file looks like. It defines the file to be version 7, though, so this probably won’t import directly into lzx. But maybe it can be loaded dynamically.

 

<?xml version="1.0"?>

<swf version="7" compressed="0">

  <Header framerate="12" frames="1">

    <size>

      <Rectangle left="0" right="3200" top="0" bottom="2400"/>

    </size>

    <tags>

      <SetBackgroundColor>

        <color>

          <Color red="255" green="255" blue="255"/>

        </color>

      </SetBackgroundColor>

      <DefineVideoStream objectID="1" frames="0" width="160"

height="120" deblocking="0" smoothing="0" codec="0"/>

      <PlaceObject2 replace="0" depth="1" objectID="1" name="videoObj">

        <transform>

          <Transform transX="0" transY="0"/>

        </transform>

      </PlaceObject2>

      <ShowFrame/>

      <End/>

    </tags>

  </Header>

</swf>

 

Here’s some more interesting stuff about swfmill:

 

http://iterative.org/swfmill/doc/using-swfmill.html

 

It is used with the mtasc actionscript compiler:

 

http://www.mtasc.org/

 

The successor to mtasc is haxe, for that that’s worth:

 

http://haxe.org/

 

It would be wicked cool to figure out a way to use these tools to dynamically generate streaming flv movies on the server, once we get OpenLaszlo playing them!

 

            -Don

 

 

_______________________________________________
Laszlo-dev mailing list
Laszlo-dev <at> openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Gmane