问题
I'm trying to write an rtmp client with flex. The problem is that I have no idea where to start. Could someone please answer how I would go about doing this, or point me to a site that does? Thanks. I don't even know what classes to use and such.
回答1:
You don't have to write your own RTMP client because Flash already implements a RTMP client called NetConnection.
To create a basic connection you could do the following:
var nc:NetConnection = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
nc.connect('rtmp://127.0.0.1/application');
function onNetStatus(e:NetStatusEvent):void
{
switch (e.info.code)
{
case 'NetConnection.Connect.Success':
// Connection with the RTMP server has been established
break;
case '...':
...
}
}
The code 'NetConnection.Connect.Success' you see is one of the codes the server returns, have a look over here for an overview of all the codes.
You should probably read up on the documentation first and then come back with a more precise question.
回答2:
See Wiki Real Time Messaging Protocol as a starting point
and there are few sample clients
JUV RTMP Client
php-rtmp-client
hopes that works
来源:https://stackoverflow.com/questions/6011684/flex-rtmp-client