Flex RTMP 客户端 [英] Flex RTMP client
问题描述
我正在尝试用 flex 编写一个 rtmp 客户端.问题是我不知道从哪里开始.有人可以回答我将如何执行此操作,或将我指向一个可以执行此操作的站点吗?谢谢.我什至不知道该使用什么类等等.
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.
推荐答案
您不必编写自己的 RTMP 客户端,因为 Flash 已经实现了一个名为 NetConnection
.
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 '...':
...
}
}
您看到的代码NetConnection.Connect.Success"是服务器返回的代码之一,请查看 此处 了解所有代码.
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.
这篇关于Flex RTMP 客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!