RED5创建新应用程序

来源:互联网 发布:settings是什么软件 编辑:程序博客网 时间:2024/06/05 08:03

1.拷贝[Red5]/doc/templates下myapp文件夹到[Red5]/webapps下;

2.修改myapp文件夹名称为自己需要的名称,比如命名为meeting_dir

3.修改red5-web.properties文件下webapp.contextPath的值为"/meeting"

4.修改red5-web.properties文件下webapp.contextPath的值为"/meeting"

5.修改red5-web.properties文件下webapp.virtualHosts=*,localhost, 127.0.0.1

6.修改web.xml下 

            <context-param><param-name>webAppRootKey</param-name>
                       <param-value>/meeting</param-value>
            </context-param>

   的myapp为/meeting

这样一个简单的应用就创建完成了.

连接这个应用程序就可以用rtmp://[主机名称]:[端口号]/应用程序名,

注意:这里的主机名称一定是在webapp.virtualHosts中列出来的,可以是域名或IP地址,应用程序名称是在上面3,4,6步骤总配置的名称

例如:rtmp://127.0.0.1:1935/meeting

----------------------------------------------------------------

关于webapp.virtualHosts的值,在网上查到一下解释:

in red5-web.properties.xml:
webapp.virtualHosts=localhost, 127.0.0.1, 192.168.1.2, ....
webapp.virtualHosts defines the ips and domains where the red5 server can be
found and the ips and domains one can use in its rtmp string to connect to
an application?
So if my Red5 server is at myserver.com I have to have:
webapp.virtualHosts=myserver.com
in order to use a rtmp string like rtmp://myserver.com/myapp

大意是说webapp.virtualHosts定义了寻找red5服务器的ip地址或域名,这些ip地址和域名被用在连接一个应用程序的remp协议字符串中.

因此如果你的red5服务器在域名myserver.com 上,你就必须设置webapp.virtualHosts=myserver.com,这样就可以用rtmp://myserver.com/myapp进行访问了