Flex RTMP client

谁都会走 提交于 2019-12-11 23:49:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!