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 <
[EMAIL PROTECTED]> 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. {
> 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: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]] 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" >> </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
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
_______________________________________________ Laszlo-dev mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
