x


Enter your email address below to receive updates each time we publish new Video Tutorial.

Privacy guaranteed. We'll never share your info.

How to Add Code to your Red5 Application - Red5 Video Tutorial

DEAR VISITOR , YOU ARE WATCHING : How to Add Code to your Red5 Application - Red5 Video Tutorial .

[postlink] http://j2ee-tutorials-videos.blogspot.com/2011/02/how-to-add-code-to-your-red5.html [/postlink] http://www.youtube.com/watch?v=WfC3qws9sMEendofvid [starttext] This is a Video Tutorial explains CREATE NEW CLASS THAT EXTENDS APPLICATIONADAPTER: Open eclipse, right click on your red5 project, (testapp for example), and select New, then select Class. In the Package field, type in a package name (com.testapp for example...its probably best to use the same one you typed into the command prompt when creating the project). In the Name field, type in the name for your class, the convention is to name it Application.java (the class that extends ApplicationAdapter is usually called Application.java). Then for the Superclass field, click on the Browse.. button next to it, then type in org.red5.server.adapter., and you can choose between ApplicationAdapter or MultithreadedApplicationAdapter. Most of the time, you'll want to choose MultithreadedApplicationAdapter, so that your application can accept multiple connections at the same time. So click on MultithreadedApplicationAdapter and click on OK button, then click Finish button.
And now it has created a new class called Application which extends MultithreadedApplicationAdapter in the com.testapp package. (notice if you expand Java Resources: src folder in the project explorer, and then expand com.testapp package, you will see the Application.java class) You can override any of the functions in MultithreadedApplicationAdapter, but you don't have to. Any function you put inside this Application class, will be accessible to your client app. So if you put an "add" function like below:
public int add(int a, int b)
{
return a+b;
}
Then you can call it from your client app, with code like this:
nc.call("add", responseHandler, 2, 3);
Expand the www folder in your project, then expand the WEB-INF folder, and open red5-web.xml, find the web.handler bean, and make sure that the class= is set to the right path of your class that extends ApplicationAdapter.
For example, if your class that extends ApplicationAdapter is called Application and it is in the com.testapp directory, then the web.handler bean's class should be set to com.testapp.Application. Like so:

If you open red5-web.properties inside www/WEB-INF, you will see the contextPath is equal to testapp (by convention it will be the same as the project name). This is the name used by the client app to connect in the rtmp path (for example rtmp://localhost/testapp).

NOTE: if you open web.xml and logback-testapp.xml, you will also see testapp within them... all these things need to match so it's best to leave it alone.

TIP: if you open the xml files, and they are in Design mode, click on the Source tab at the bottom of the file and it will be easier to modify and work with.
[endtext]
This site does not store any files on its server.We only index and link to content provided by other sites.If you have any doubts about legality of content or you have another suspicions, feel free to contact us HERE - Thank you.

0 commentaires :

Post a Comment

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

You can see also

J2EE is an acronym for Java 2 Enterprise Edition. The Java 2 Enterprise Edition is Software that can be used along with the J2SE, the Java 2 Standard Edition which includes the compiler and the other fundamentals of Java. The J2EE software includes development and deployment systems for Java Servlet and Java ServerPages. Both of these combine Java and HTML to produce web pages on demand. Author Mohamed Habou . understand this powerful component of Java programming.

Android Cloud To Device Messaging Video Tutorial

JPA Video Tutorial

Spring MVC Video Tutorial

Spring Security Video Tutorial

Primefaces Video Tutorial

Struts Video Tutorial

free counters

Introduction to J2EE Videos Tutorials

Latest GWT Video Tutorials

Latest Spring Videos Tutorials

Latest Hibernate Videos Tutorials

Latest JAVA Video Tutorials

Latest Struts Videos Tutorials

J2EE is an acronym for Java 2 Enterprise Edition. The Java 2 Enterprise Edition is Software that can be used along with the J2SE, the Java 2 Standard Edition which includes the compiler and the other fundamentals of Java. The J2EE software includes development and deployment systems for Java Servlet and Java ServerPages. Both of these combine Java and HTML to produce web pages on demand. VTC Author Mohamed Habou takes you on a step by step guide to understanding this powerful component of Java programming.