[Red5] How to use RTMPT with red5 0.7 (war) ?
Pierrick Grasland
pierrick.grasland at gmail.com
Thu Jul 17 09:10:36 PDT 2008
Hello,
I'm actually using red5 0.7 (war version, directly from
http://osflash.org/red5) in Jetty. It's work fine with rtmp, but when i'm
trying to connect to rtmpt, I only receive the following event :
NetConnection.Connect.Failed.
I try to find documentation on how to use RTMPT, with an example, but found
nothing, except : 'use rtmpt://url instead of rtmp://url and activate
RTMPTServlet in web.xml'
So, I'm hoping for a link to documentation or example of use of rtmpt, or a
list of the differents steps needed to activate this functionnality.
I'm also listing below several attempts and my current configuration, in
hope someone can show me what's wrong.
List of attempts :
[info]Attempting to connect to : rtmpt://192.168.1.209:8088/nexpressoflash
[info]NetConnection.Connect.Failed
[info]Attempting to connect to : rtmpt://192.168.1.209:80/nexpressoflash
[info]NetConnection.Connect.Failed
In my mxml file, I'm using the following :
private function init():void {
log("initializing 33", "info");
//rtmpUrl = givenPath.text;
rtmpUrl = "rtmpt://192.168.1.209/nexpressoflash";
getVars();
initMicrophone();
netConnection = new NetConnection();
netConnection.objectEncoding = ObjectEncoding.AMF0;
netConnection.client = this;
netConnection.addEventListener(NetStatusEvent.NET_STATUS ,
netStatus );
netConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
securityErrorHandler);
log("Attempting to connect to : " + rtmpUrl, "info");
netConnection.connect(rtmpUrl);
}
(where log is an utility function for writing text in a textArea)
I have read at this page http://jira.red5.org/browse/APPSERVER-124 the
requirement for rtmpt : Enable RTMPTServlet, so I'm using the following in
my configuration :
(see end of message for global web.xml)
* <servlet>
<servlet-name>rtmpt</servlet-name>
<servlet-class>org.red5.server.net.rtmpt.RTMPTServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>rtmpt</servlet-name>
<url-pattern>/open/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>rtmpt</servlet-name>
<url-pattern>/idle/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>rtmpt</servlet-name>
<url-pattern>/send/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>rtmpt</servlet-name>
<url-pattern>/close/*</url-pattern>
</servlet-mapping>
*If I try RTMP instead, I can easily connect to my server :
[info]Attempting to connect to : rtmp://192.168.1.209/nexpressoflash
[info]NetConnection.Connect.Success
So, I think my scope is good for my application.
I activate all log on Red5, but nothing specific to RTMPT seems available,
except the following line :
*
2008-07-17 17:37:53,453 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Creating shared instance of singleton bean 'rtmptConnManager'
2008-07-17 17:37:53,468 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Creating instance of bean 'rtmptConnManager' with merged definition [Root
bean: class [org.red5.server.net.rtmp.RTMPConnManager]; scope=singleton;
abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0;
dependencyCheck=0; factoryBeanName=null; factoryMethodName=null;
initMethodName=null; destroyMethodName=null; defined in class path resource
[red5-core.xml]]
2008-07-17 17:37:53,500 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Eagerly caching bean 'rtmptConnManager' to allow for resolving potential
circular references
2008-07-17 17:37:53,515 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Creating shared instance of singleton bean 'rtmptHandler'
2008-07-17 17:37:53,531 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Creating instance of bean 'rtmptHandler' with merged definition [Root bean:
class [org.red5.server.net.rtmpt.RTMPTHandler]; scope=singleton;
abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=2;
dependencyCheck=0; factoryBeanName=null; factoryMethodName=null;
initMethodName=null; destroyMethodName=null; defined in class path resource
[red5-core.xml]]
2008-07-17 17:37:53,562 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Eagerly caching bean 'rtmptHandler' to allow for resolving potential
circular references
2008-07-17 17:37:53,578 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Returning cached instance of singleton bean 'red5.server'
2008-07-17 17:37:53,593 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Autowiring by type from bean name 'rtmptHandler' via property 'server' to
bean named 'red5.server'
2008-07-17 17:37:53,609 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Returning cached instance of singleton bean 'statusObjectService'
2008-07-17 17:37:53,640 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Autowiring by type from bean name 'rtmptHandler' via property
'statusObjectService' to bean named 'statusObjectService'
2008-07-17 17:37:53,656 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Returning cached instance of singleton bean 'rtmpCodecFactory'
2008-07-17 17:37:53,671 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Creating shared instance of singleton bean 'rtmptServlet'
2008-07-17 17:37:53,687 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Creating instance of bean 'rtmptServlet' with merged definition [Root bean:
class [org.red5.server.net.rtmpt.RTMPTServlet]; scope=singleton;
abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0;
dependencyCheck=0; factoryBeanName=null; factoryMethodName=null;
initMethodName=null; destroyMethodName=null; defined in class path resource
[red5-core.xml]]
2008-07-17 17:37:53,734 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Eagerly caching bean 'rtmptServlet' to allow for resolving potential
circular references
2008-07-17 17:37:53,750 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Returning cached instance of singleton bean 'rtmptHandler'
2008-07-17 17:37:53,765 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory -
Returning cached instance of singleton bean 'rtmptConnManager'*
...*
2008-07-17 17:37:55,765 [main] DEBUG o.red5.server.war.WarLoaderServlet -
Root context path: /nexpressoflash
2008-07-17 17:37:55,765 [main] INFO o.red5.server.war.WarLoaderServlet -
Startup done in: 12172 ms*
Regards,
--
Pierrick Grasland
web.xml :
*<?xml version="1.0" encoding="UTF-8"?>
<web-app
version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--
** For use with servlet v2.5 replace the lines above with these
version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-->
<display-name>nexpressoflash</display-name>
<context-param>
<param-name>globalScope</param-name>
<param-value>default</param-value>
</context-param>
<context-param>
<param-name>parentContextKey</param-name>
<param-value>default.context</param-value>
</context-param>
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>/</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/classes/*-web.xml</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.red5.server.war.WarLoaderServlet</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<servlet>
<servlet-name>testpage</servlet-name>
<servlet-class>com.nexcom.nexpressoflash.webUA.TestPage</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>testpage</servlet-name>
<url-pattern>/testpage</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>rtmpt</servlet-name>
<servlet-class>org.red5.server.net.rtmpt.RTMPTServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>rtmpt</servlet-name>
<url-pattern>/open/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>rtmpt</servlet-name>
<url-pattern>/idle/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>rtmpt</servlet-name>
<url-pattern>/send/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>rtmpt</servlet-name>
<url-pattern>/close/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>login.html</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
<security-constraint>
<web-resource-collection>
<web-resource-name>Forbidden</web-resource-name>
<url-pattern>/WEB-INF/*</url-pattern>
</web-resource-collection>
<auth-constraint />
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Forbidden</web-resource-name>
<url-pattern>/persistence/*</url-pattern>
</web-resource-collection>
<auth-constraint />
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Forbidden</web-resource-name>
<url-pattern>/streams/*</url-pattern>
</web-resource-collection>
<auth-constraint />
</security-constraint>
</web-app>
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/red5_osflash.org/attachments/20080717/862559f3/attachment.html
More information about the Red5
mailing list