Nick
Nick

Reputation: 19664

How do I play an FLV file in Haxe?

It is very difficult to find good resources for Haxe information so I am hoping someone out there can help me. I have an FLV movie in the same directory as the SWF I am generating. I cannot get the FLV to play. I can get this working in AS but I need to know what I am doing wrong in my Haxe code.

Hope someone can help.

var mc:MovieClip = Lib._root;       

var connection:NetConnection = new NetConnection();
connection.connect(null);
var stream:NetStream = new NetStream(connection);

mc.attachVideo(stream);
trace(mc.flash.Video);
stream.play("default.flv");

Upvotes: 1

Views: 1426

Answers (3)

Juan Delgado
Juan Delgado

Reputation: 2030

There's nothing inherently different from Haxe and AS when it comes to play video as you would be using AS libraries. To which player are you compiling to? Because if you are compiling to player >= 9 you are missing a few bits.

You can check out my example of AS3 player here (scroll down to createVideo()) to find out exactly what (create the Video object, attach to the display list, etc).

I'm also guessing that you are not getting any compiler errors, right?

Juan

Upvotes: 0

ryantm
ryantm

Reputation: 8417

Here is a Google Code project that demos a nice flash media server. It plays and even records videos. http://code.google.com/p/haxevideo/

Upvotes: 2

stroncium
stroncium

Reputation: 1430

What player version do you target? For 10 the stage is flash.Lib.current. Do haxe compiler says something about errors?

Upvotes: 0

Related Questions