PDA

View Full Version : FMS2,AS3 Streaming of FLV Files


Infineon
12-21-2007, 12:13 PM
Hi there,

first of all thanks for help that might come here.
Second i need to say that my english could be a bit crappy :D

Following is my problem:

------

What do i want?
- FMS2 Streaming of FLV Files (real stream, no progressive download)
- AS3,CS3 Flash Client application that connects to server

What do i got?
- FMS2 installed and running
- Working Code in AS2 or AS3

Whats my problem?
- rtmp streams dont show up

------

Files & Paths
FMS2DIR\applications\testApplikaton\
FMS2DIR\applications\testApplikaton\main.asc
FMS2DIR\applications\testApplikaton\streams\_defin st_\
FMS2DIR\applications\testApplikaton\streams\_defin st_\test.flv

main.asc
FLVPlayback Component

AS3 Code

var nc:NetConnection = new NetConnection();
var ns:NetStream;

nc.objectEncoding = flash.net.ObjectEncoding.AMF0;
nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);

var counter:int = 0;

function onNetStatus(evt:NetStatusEvent):void {

trace(evt.info.code);

if (evt.info.code =="NetConnection.Connect.Success") {

ns = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);

var myVideo:Video = new Video(320,240);

myVideo.attachNetStream(ns);

addChild(myVideo);

ns.bufferTime = 5;
ns.play("test",true);
}

}
nc.connect("rtmp://localhost/testApplikation/",true);

function asyncErrorHandler(event:AsyncErrorEvent):void
{
trace(event.text);
}
NetConnection.prototype.onBWDone = function(p_bw) {
trace("onBWDone: "+p_bw);
};
NetConnection.prototype.onBWCheck = function() {
return ++counter; // Serverside, just ignore any return value and return the call count
};

Log:
NetConnection.Connect.Success
NetStream.Play.Reset
onBWDone: 5486
NetStream.Play.Stop
Error #2095: flash.net.NetStream konnte Rückruf onPlayStatus nicht auslösen.
NetStream.Buffer.Flush

Server
Shows 1 connected Client
2 entrys at Streams Tab

* *flv:test Type: Stored
o name: ""
o status: idle
o client: rAAooWHF
o time: 0
* DBAooWHF Type: NetStream
o size: 3254094
o modfied: *date*
o cache misses: 1
o ^ hits: 0
o ^ segments: 0
o ^ bytes: 0




Also the AS2 Code of following FMSGuru Tutorial (http://www.fmsguru.com/showtutorial.cfm?tutorialID=3)
doenst work.


var nc:NetConnection = new NetConnection;
var ns:NetStream;

nc.onStatus = function(info){
trace(info.code);
if(info.code == "NetConnection.Connect.Success"){
startStream();
}
}

function startStream(){
ns = new NetStream(nc);
vid.attachNetStream(ns);
ns.play("test");
}

nc.connect("rtmp://127.0.0.1/testApplikation/inst/");

So it seems like it is a Server problem.
I also installed the Server on different machines and got the same problem.


If i use only the FLVPlayback Component on rtmp://127.0.0.1/testApplikation/test2.flv the opening in Flash returns an error.

I dont know what to do and i would love some help.

:D Greets from Germany

Infineon
12-21-2007, 02:20 PM
installed red5 and it works direct :(

rage128
05-14-2009, 11:03 PM
Hi Infineon here (http://www.leblebistudio.com/adobe-flash-media-server-video-chat-uygulamasi/)is an video chat application example with fms2 and as3
i hope that will be usefull for u