Skip to main content
February 16, 2007
Question

Streaming FLV Problem

  • February 16, 2007
  • 1 reply
  • 215 views
Hi,
I have problem with it. I'm very new in FMS2 and no background in FCS as well.
I've tried to test my application through FMS2 by using NetConnection and NetStream script
Here is my code


var _nc:NetConnection = new NetConnection();
_nc.connect("rtmp://localhost/test");
_nc.onStatus = function(_info) {
trace(info.code)
};
var _ns:NetStream = new NetStream(_nc);
_root.display.attachVideo(_ns);
_ns.play("test.flv"); // _ns.play("test")



App Dir folder::
C:/Program Files/Macromedia/Flash Media Server 2/applications/test/streams/test/test.flv
C:/Program Files/Macromedia/Flash Media Server 2/applications/test/scripts/main.asc (Original main.asc)

My swf and fla named "test.swf" and "test.fla" are anywhere on the same computer.

I didn't edit any xml file in conf folder. All the files on FMS2 are original.
However the output window show "undefined". How should I do?
I should configure somethings more?

I've used FLVPlayback and MediaDisplay component to link with "rtmp://localhost/test/test/test.flv" or "rtmp://localhost/test/test/test".
They works! We can see the video.
Somebody can suggest me? I'll be very appreciate.

THANX
    This topic has been closed for replies.

    1 reply

    February 18, 2007
    I think you need to create a Video object, drag it to the stage, set its dimensions, give it a name (try "theVideo") and then in actionscript, prior to _ns.play(), run this:

    theVideo.attachVideo(_ns);

    Then call _ns.play(). See if that helps!