Create New Java Red5 Application - Tsavo
Create New Java Red5 Application - Tsavo
Create New Java Red5 Application - Tsavo
Tsavo
24/4/2014
This is the root folder of all your red5 application definitions, from which all red5 applications are started. This is the global scope. If you are running a hosting service this would be your root folder. To create a section for each hosted user you would create a WEB-INF/user-dir as shown below; 2. Create your new application as follows (The new application name for this tutorial will be called red5java) # m k d i rpr e d 5 j a v a / W E B I N F re5java is the name of your application in this example. You will access your application using the URL rtmp://your-ip/red5java or rtmpt//your-ip/red5java in the case of a proxy-tunneled RTMPT connection). The WEB-INF folder is so that Jetty (the Embeddable HTTP Server and Servlet Container that is used by the Standalone red5 server) knows where to access your application (Servlet) from. This is because your application is actually a JAVA servlet. It is in the WEB-INF file that you will load all the configuration files/beans that will be required to load your application. These files specify all the Spring beans that your application will require as well as bean definitions that will be used by Spring to Dependency Inject your application. These config files include web.xml, red5-web.xml, red5-web.properties and log4j.properties as will be shown below. Under the red5java directory create a folder called src where you will create your own custom application that will be used to communicate with the Flash clients. # m k d i rs r c This would also be a good point at which to create your classes (for the classes) and lib (for the jar file) directories. We will also be doing this in the ant build file below but so that we get the concept, lets create the directories here; # m k d i rc l a s s e s& &m k d i rl i b We now need to create a package for our Application. Lets call it org.red5.webapps.red5java # c ds r c # m k d i rpo r g / r e d 5 / w e b a p p s / r e d 5 j a v a Your sources will go into the org/red5/webapps/red5java directory. [*TODO: Verify and test the statement below*] red5java represents your application scope under the global scope ie webapps. Sub-folders under red5java would represent your room scope ie all subfolders under red5java are subscopes of the red5java application scope. If you are on Windows, you can create your directory structure from within eclipse, so that it will look something like this. After you create the src directory, under WEB-INF, right click src directory then New>Package and create a package so that it has the structure shown below (Dont worry, since you are downloading the sources, these folders are already created for you): >| r e d 5 _ s e r v e r ->| w e b a p p s ->| r e d 5 j a v a ->| W E B I N F ->| s r c
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/ 2/38
24/4/2014
->| y o u r ->| p a c k a g e ->| n a m e ->| c l a s s e s ->| l i b The build.xml file that came with the sources can prepare the classes and lib directories for you, simply type: # a n tp r e p a r e To clean out directories after a build, type: # a n tc l e a n You can change the target of your build by editing the source and target tags. For 1.6, change from 1.5 to 1.6. Now, for the concept: If you created a new application (as we will later) eg MYAPPLICATION, your directory structure would look more or less look like this: >| r e d 5 _ s e r v e r ->| w e b a p p s ->| M Y A P P L I C A T I O N ->| W E B I N F ->| s r c ->| y o u r ->| p a c k a g e ->| n a m e ->| c l a s s e s ->| l i b 3. Let us now study the following files which are contained within the WEB-INF folder: web.xml, red5-web.xml, red5-web.properties, log4j.properties, build.xml. These files are ordinarily dropped in the WEB-INF folder: red5_server > webapps > red5java > WEB-INF > drop them here!: a) web.xml: This is the first file that your Jetty/Tomcat Servlet engine will read. The parameter webAppRootKey defines the application context of your application. This file required by the servelet specification and is the standard deployment descriptor used by your Servlet engine. It will be used to load the other 3 files below. Again consult Joachims migration guide. b) red5-web.xml: This config file is used to configure and load your scope/context handler, your virtual-host configuration and your very own application. This is file is used by the Spring Framework IoC beans when Dependency Injecting your Servlet so it can be correctly instantiated within the red5 server. It is also within this file that you configure your Handlers. The Handlers are the methods that are called when a flash client connects to your application ie rtmp://your-ip/your-application. yourapplication represents an application scope and so these Handler/Methods are valid within your
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/ 3/38
24/4/2014
application scope. Thus, your Handlers will be able to react when a flash client connects or leaves your application scope, you need to implement the interface org.red5.server.api.IScopeHandler. Joachim Bauchs tutorial explains this in good detail: HOWTO-NewApplications.txt The Dependency Injection specified by the bean id web.handler is very important or else your application might not start. Please ensure you specify the correct classpath of your application here. c) red5-web.properties: This file is imported into the red5-web.xml file. Use this file for items that often change within your configuration eg the contextPath (ie name of your application scope) or virtualHosts directives (which might change from one hosted service to another). If you open the file red5-web.xml, you will see that the Spring PropertyPlaceholderConfigurer bean is used to load the red5.properties file. The contextPath and virtualHosts properties are loaded within the red5-web.xml file by using the variables ${webapp.contextPath} and ${webapp.virtualHosts} respectively. d) log4j.properties: This is used to configure the logging properties of your application by using the log4j libraries. This file will be used by the org.apache.commons.logging LogFactory class. For the settings in this file to take effect, you have to register the logger for your application in this file. (Alternatively though, you could add your log4j definition in the conf/log4j.properties file, together with the logging definitions for the other sample Red5 applications. However, you may just use the log4j.properties file that is within your own application). Add the following entry (modify as appropriate for your own application): In red5_server/webapps/red5java/WEB-INF/log4j.properties or red5_server/conf/log4j.properties: l o g 4 j . l o g g e r . o r g . r e d 5 . w e b a p p s . r e d 5 j a v a = D E B U G In your class you will retreive the log by using: p r o t e c t e ds t a t i cL o gl o g=\ L o g F a c t o r y . g e t L o g ( A p p l i c a t i o n . c l a s s . g e t N a m e ( ) ) ; You can obtain a template of these files from within the red5 server folder by going to doc/templates/myapp/WEB-INF The combination of the above 4 files is used to instantiate your red5 application. This is the application we will be using to communicate with flash clients for this tutorial. e) build.xml: This is the file that we will use to compile our application before restarting red5. You may use this example build file to compile/build for your own custom applications. Modify the following parameters as appropriate: In our case it was red5java.jar and so we have: 4. Now going back to Eclipse, click within the Naviator Panel and then click F5 to refresh your Navigator panel. You will now see the folder red5java under webapps. Under red5java is WEB-INF and under WEB-INF is src. The folder src contains the folders that represent your package above ie org.red5.webapps.red5java [Please note that all Shared Objects below are "Remote Shared Objects" ie they are stored on the Server, not the flash client]
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/ 4/38
24/4/2014
CREATE A PLAYLIST AND STORE IT WITHIN TRANSIENT RED5 SERVER SHARED OBJECT USING JAVA AND OTHER SHARED OBJECTS FUNCTIONALITY In this section we will create a Shared Red5 object. This object represents a Playlist of all available content. Once this playlist has been loaded into the Shared Object, all Flash clients that connect to our red5java application scope will have access to the same playlist. This is because in an ideal environment, we would only need one playlist for all our Flash clients. This playlist could typically be loaded from an XML file (see loadPlayList method of Application.java). But rather than always re-reading the XML file everytime a client connects, this XML could be loaded only once when the first client connects and then made immediately available to all other clients when they connect. This is why we put the method appStart(IScope app) hook. [****This is a very important NOTE****: When debugging your application, do not put any code inside the appStart method unless you are absolutely sure it works. This is because an error in the application scope of your application will result in your application never ever even seeing the light of day. Debug in say appConnect method (so you are able to view related debug logs) and only transfer to appStart once you are sure it works.] 1. From your red5java WEB-INF folder, right click and create a new folder called playlist. Inside this folder we drop the following file inside this playlist folder: playlist.xml Now while still within your red5java WEB-INF folder, navigate to org>red5>server>webapps>red5java>WEB-INF>src>org>red5>webapps>red5java. The following source java files are dropped in: Application.java, DemoService.java, SOEventListener.java, SOHandler.java, ScheduledJob.java. These are the files that we will use to demonstrate creation of transient/non-persisted shared objects, handlers, listeners and a scheduled job. Our package name is org.red5.webapps.red5java Below I explain some aspects of this example red5 application. 2. The Application.java. > Application.java is the scope handler of you application. By extending the ApplicationAdapter class, we can determine or code what happens whenever the application is started, whenever the a new client connects or disconnects and whenever an application is stopped. > loadPlayList loads playlist items from an xml file. The main scope of your red5 application will be the folder of your red5 appliction. In our case, the main scope was therefore red5java. Thus on doing the following: R e s o u r c ep l a y l i s t X M L= \t h i s . a p p S c o p e . g e t R e s o u r c e ( f i l e N a m e ) ; we actually get the resource from red5java/playlist/playlist.xml We retreive the Inputstream to the xml file by using the usual JAVA BufferedReader. 3. The DemoService.java There is no reason we could not have put the methods in this file in the Application.java file. However, we all know that it is good programming practise to separate application logic into different classes depending on the pattern that emerges in your application. Anyway, that wont be the case for now, I just want to show you something very interesting
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/ 5/38
24/4/2014
Methods in DemoService.java are called from the flex2 client using the following call for example: n c . c a l l ( " d e m o S e r v i c e . g e t P l a y L i s t " ,n c _ r e s p o n d e r ) ; Now for the interesting question, how the hell does by flash client get to know how and where to call the demoservice.getPlayList method from. How does it do this? This is accomplished by wiring your DemoService class in the red5-web.xml file, through defining its bean in this file. If you have more classes, this is exactly the same place you would place them in. Thus, whenever your flash client calls a remote red5 method, the rtmp handler will be able in turn find and call your class due to this bean definition(**confirm/test this statement). You will also notice that the red5-web.xml file contains a bean definition for the Application.java file above; it is defined as the main web handler of your application as described above. Here are the bean definitions we are talking about in the red5-web.xml file: b e a ni d = " w e b . h a n d l e r "c l a s s = " o r g . r e d 5 . w e b a p p s . r e d 5 j a v a . A p p l i c a t i o n " and b e a ni d = " d e m o S e r v i c e . s e r v i c e "c l a s s = " o r g . r e d 5 . w e b a p p s . r e d 5 j a v a . D e m o S e r v i c e "
The new service you define in red5-web.xml should end with service, so that red5 will be able to invoke it. 4. You may call getPlayList method that makes use of a "Transient Shared Object" from the flex2 application which you can download from here: red5_flexclient.tar.gz Open the Flash client from the following URL. Put the following URL: rtmp://ip-of-your-red5server/red5java. Click the "Connect" button. On connecting to the red5 application from the flash client, the following happens: >the xml playlist is loaded into a transient shared object, once only during the start of the application. To veiw the contents of this shared object, select getPlayList method and click on the Execute button. You will see the contents of the playListSO SharedObject we loaded in the red5 server printed on the Text Area. However, this method will only work with the latest trunk of red5. >a counter of all the persons who have connected to your application scope is printed by clicking on the Execute button after selecting the getCounter method (This method should work with the latest release of red5). Follow this sequence several times to see the counter changing: Connect>select getCounter >click Execute>click Disconnect>click Connect>select getCounter>click Execute ... etc... >a transient shared object with a listener is created in the red5 initTSOwithListener() method. The listener should be triggered whenever a change occurs to the shared object. To demonstrate this, select the sendMessage(trigger Red5 TSO update) method and click execute. If you go to the red5_server console, you will see the default message "This is to modify TSO" printed, and onSharedObjectUpdate for the SOEventListener triggered. You may change the message that is
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/ 6/38
24/4/2014
sent to red5 by entering your own text, inside the textbox labelled Message(message to send to red5). This textbox can also be used to change the message used to update the persistent shared object with listener below. At this point it is very important that I mention that make sure that you put your onSharedObjectUpdate functionality in the o n S h a r e d O b j e c t U p d a t e\ ( I S h a r e d O b j e c t B a s es o ,S t r i n gk e y ,O b j e c tv a l u e ) and not onSharedObjectUpdate functionality in the o n S h a r e d O b j e c t U p d a t e\ ( I S h a r e d O b j e c ts o ,S t r i n gk e y ,O b j e c tv a l u e ) or else the onSharedObjectUpdate Event will never be triggered. Please remember this as it is very easy to confuse these 2 interface methods. > a persistent shared object with a listener is created with the initPSOwithListener method, and just like the transient shared object above, the listener should be triggered everytime there is a change with the persistent shared object. Again, if you experience problems with this method, delete the red5java/persistence/SharedObjects folder. > Calling a remote shared object method using remote_sharedobject.send("handler", "args") should cause your red5 shared object handler to be called. Shared object handlers can either be defined in red5-web.xml or by defining a Handler class and registering it using the sharedobject registerServiceHandler method. Please consult Joachim's guide for a good explanation of this. >If on the flex client you listen for change events on shared objects, then red5 will enable this synchronisation for you, so that whenever a sharedobject value changes, the flex client will be informed. Please refer the red5_flexclient.tar.gz sources for examples of how to do this. SHARED OBJECT LISTENERS NOTES These implement the ISharedListener interface. 1. You can register several listener classes (which in our case was SOEventListener), for the same shared object. 2. Several SharedObjects can use the same listener. Simply identify the shared object attributes whose values are changing by ensuring names (keys to the shared object attributes/values) are unique. React differently if the name returned is different. SHARED OBJECT HANDLERS NOTES 1. You may call a remote shared object from the red5 server by using SharedObject.getRemote syntax (please see the red5_flexclient sources attached). 2. You may call a red5 method (without ever having to register the class in red5-web.xml), by using so.registerServiceHandler syntax, where you can register a method handler for a shared object (You may still do the same using the red5-web.xml file though - see Joachim's migration guide). You then call this method using the remote_so.send syntax (refer to the red5_flexclient.tar.gz for how to do so) SCHEDULE FOR THE PLAYLIST TO BE RELOADED EVERY 1 HOUR USING JAVA You might want the playlist Transient shared object above to be reloaded every 10 minutes with updated content from a changing playlist.xml file. The Application.java and ScheduledJob.java files shows you how to create a regularly scheduled job.
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/ 7/38
24/4/2014
BUILD YOUR RED5 APPLICATION Whenever you make a change to your application, you need to rebuild it and restart red5. Using the red5java build file provided, here's an example that allows you to automate and speed up this process using ant: 1. First create red5.jar by running from within the root/base of the red5 source folder. You only need to do this once (ie just after downloading red5), and not all the time. # a n tj a r 2. Now go to the red5java directory within your webapps directory and do: # a n tb u i l d To adapt the build.xml file for yourself, simply change the following build.xml items depending on your system: >target.jar (put the name of your own jar file) >source= (put 1.5 or 1.6 depending on the java jvm version you are running on your machine) >target= (put 1.5 or 1.6 depending on the java jvm version you are running on your machine) 3. If your application builds successfully, restart red5 using ant server, ./red5.sh or red5.bat and then try to connect to your red5 application using the sample flex2 application you have modified. CONCLUSION The code written here is by no means clean and is not designed using the best principles. Most of it was written while half-asleep . It is only meant as a guide so you are able to see Red5 in action by example based on Joachim's Migration Guide. In addition, this code has been little tested and therefore comes with no warranty whatsoever. SPRING REFERENCES 1. http://www.onjava.com/pub/a/onjava/2005/05/11/spring.html 2. http://www.springframework.org/docs/reference/beans.html FLEX2 REFERENCES 1. http://flash-communications.net/technotes/fms2/flex2FMS/index.html 2. http://livedocs.macromedia.com/flex/15/asdocs_en/ 3. http://www.amfphp.org/docs/datatypes.html 4. http://coenraets.org/testdrive/flex4j/index.htm 5. http://www.adobe.com/devnet/flashmediaserver/articles/rmi_fms2_02.html 6. http://livedocs.macromedia.com/flex/201/langref/flash/net/SharedObject.html#send() LOG4J REFERENCE 1. http://jakarta.apache.org/commons/logging/commons-logging1.0.4/docs/apidocs/org/apache/commons/logging/package-summary.html 2. http://gef.tigris.org/LoggerConfiguration.html 3. http://www.spikesource.com/docs/cs_1.4-linux/doc/commons-logging/commonslogging_quickstartguide.html RED5 FUTURE DIRECTORY STRUCTURE http://jira.red5.org/confluence/display/appserver/3rd+proposal+or+Searching+the+Holy+Grail
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
8/38
24/4/2014
Permalink
102 Comments
1.
2.
jwamicha said
February 8, 2007 @ 11:30 pm Hi Bobby, Thanks. I would probably add the character validation methods on the flash client side rather than server side. The server side just acts as a passage way for the chat messages. Reply
3.
piha said
9/38
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
24/4/2014
February 11, 2007 @ 1:07 am all links to 196.202.192.126 are broken. Reply
4.
jwamicha said
February 11, 2007 @ 9:23 am We had a temporary outage yesterday. It should be back on now though. Reply
5.
Thijs said
February 11, 2007 @ 9:21 pm Great tutorlal Joseph!! I added it on the Red5 wiki page: http://osflash.org/red5#red5_help_and_information Reply
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
10/38
24/4/2014
6.
jwamicha said
February 11, 2007 @ 11:51 pm Wow! Thanks alot Thijs! Reply
7.
8.
9.
goood.guy said
March 6, 2007 @ 12:35 pm Is there a way to use the FLVPlayback compontent with red5 to stream flv-videos? Reply
10.
Alan D said
March 7, 2007 @ 4:53 pm I followed the instructions but still no luck, can anyone help? It compiles ok in Eclipse but it doesnt create a .jar file. Also, when I restart Red5 and try to test using red5_tester.swf I get the following message: description = No scope red5java on this server.
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
11/38
24/4/2014
Reply
11.
jwamicha said
March 7, 2007 @ 6:02 pm Hi good.guy, Yes it is possible to do so. Please check out the following post: http://www.mail-archive.com/[email protected]/msg04567.html Reply
12.
jwamicha said
March 7, 2007 @ 6:05 pm Hi Alan, The reason the jar file isnt created is because it is not the default target of the ant build file. You need to run off the shell/command prompt: >ant jar For the jar file to be created. Have you tried downloading the flexclient code that comes with this tutorial? It will connect to the red5java application scope ok. Reply
13.
Dragos said
March 19, 2007 @ 2:53 pm Hi jwamicha, I cant download the files, the server doesnt respond to ping, please could you be so kind and post them somewhere red5java.tar.gz and red5_flexclient.tar.gz Thanks, Dragos Reply
14.
jwamicha said
March 19, 2007 @ 6:23 pm Hi Dragos, We have been having problems with our ISP since Friday. I have put in some new links. Please let me know if you are still unable to reach the server.
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
12/38
24/4/2014
Reply
15.
Omar said
March 27, 2007 @ 8:53 pm Hi everyone, Ive developed some apps but I still with the same problem. How can I call a method located at my client-side application (at te .fla or .swf file) from my java application? thanks Reply
16.
jwamicha said
March 27, 2007 @ 11:20 pm Hi Omar, You need to use something like: import org.red5.server.api.service.IServiceCapableConnection; IServiceCapableConnection service = (IServiceCapableConnection) conn; service.invoke(setId, new Object[] { conn.getClient().getId() }, this); Where setID would be a public function on your flash client. Object[] array will contain all the parameters of your flash function. If I remember well,a good example is in fitcDemos Application.java Reply
17.
Omar said
March 27, 2007 @ 11:59 pm Ok, Ill try, thanks Reply
18.
Omar said
March 29, 2007 @ 12:51 am Hi, Its me again I have done this:
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
13/38
24/4/2014
-[Server side] public void ChangeThumbnail(int direction) { Object[] parameters = {1}; IServiceCapableConnection service = (IServiceCapableConnection)Red5.getConnectionLocal(); service.invoke(change, parameters,this); } public void resultReceived(IPendingServiceCall ipsc) { System.out.println(Resultado:+ipsc.toString()); } -[Client side (.fla file)] conexion = new NetConnection(); conexion.connect(rtmp://localhost/app); conexion.onStatus=ConnStatus; function ConnStatus(obj) { for (e in obj) { trace(Connection ["+e+" : "+obj[e]+]); } } -[Client-side output]Connection Connection [description : Connection succeeded.] Connection [level : status] Conexion [application : null] Reply
19.
Omar said
March 29, 2007 @ 12:52 am Conexion [application : null] Reply
20.
Omar said
March 29, 2007 @ 12:59 am
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
Connection [application : null] I think that this is the problem, isnt it?
14/38
24/4/2014
Connection [application : null] I think that this is the problem, isnt it? [Server-side output]Service: null Method: change Num Params: 10: 1 And theres no change, I have to change a thumbnail on a swf app but I cant do that, excuse me for my ignorance. Reply
21.
chrm said
March 30, 2007 @ 11:20 am How I can to obtain a files of the Tutorial. Server http://www.korandu.com/ is dont responce. Reply
22.
chrm said
March 30, 2007 @ 11:28 am Tanx, it works! Reply
23.
David said
April 21, 2007 @ 2:38 am I have no familiarity with Flex. Have done the Red5 setup and then ran swf in flexclient but nothing happened. I assume one needs a copy of Flex to get this to happen. And if so what needs to be changed on the client side to make this work? Reply
24.
David said
April 21, 2007 @ 11:42 am So I decided to take matters into my own hands. I downloaded the Flex2 SDK, lobbed the Flex client into the Flex2 samples directory and after checking the names of all directories were correct I ran ant to build the Flex client. I got the build error: BUILD FAILED E:\Flex2\samples\red5_flexclient\build.xml:29: Execute failed: java.io.IOException:
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
15/38
24/4/2014
CreateProcess: E:\Flex2\bin\mxmlc -default-frame-rate=30 -incremental=true -defaultbackground-color=0x869CA7 -default-size 900 650 E:\Flex2\samples\red5_flexclient/src/main.mxml o=E:\Flex2\samples\red5_flexclient/bin/main.swf error=193 So undaunted I ran the mxmlc compiler command directly from the command line and it worked the client was successfully rebuilt! Would just like to know why that ant build is failing. Reply
25.
26.
jwamicha said
April 30, 2007 @ 4:50 pm Hey guys Im really sorry! Im looking for a permanent hosting solution for this as the server in our office just will not do! Should be solved by Wednesday! Reply
27.
jwamicha said
May 9, 2007 @ 3:05 pm Finally a mirror for guys who have been having problems downloading! Reply
28.
omar said
May 15, 2007 @ 2:04 am hi
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
16/38
24/4/2014
Im finishing my red5 app, my app handles video and Ive mount it on a server in my company but when I play video it plays for a while (about 5 seconds), then it stops for a long time, then plays a while and stops, does everyone knows why? Reply
29.
30.
Ilias said
July 8, 2007 @ 5:58 pm interesting Reply
31.
Kris said
July 9, 2007 @ 7:02 pm Cool. Reply
32.
Constantinos said
July 10, 2007 @ 12:01 am interesting Reply
33.
omar said
July 10, 2007 @ 12:07 am
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
17/38
24/4/2014
hi, ive finally made my full app with red5 and flash even when I dont know much abput flash well, before, I have a question, someone knows how where developed the .fla apps that come with red5???? Ive tried it but I havent found code on the apps, just images Reply
34.
Vaggelis said
July 10, 2007 @ 1:15 pm Nice! Reply
35.
Chrysostomos said
July 10, 2007 @ 2:51 pm Cool Reply
36.
Angelo said
July 10, 2007 @ 8:19 pm Nice Reply
37.
Stefanos said
July 11, 2007 @ 8:14 am Nice! Reply
38.
Sreenivas said
July 12, 2007 @ 3:04 pm
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
18/38
24/4/2014
Hi jwamicha, just two days before i came to about Red5 flash server. Will Red5 work with java/jsp files/tomcat sever or will it only work for Spring framework/jetty server/tomcat server. I have a requirement where i have use video conferensing in jsp pages of my web application which is running on tomcat server. please tell how to handle the above problem.give an example Thanks Reply
39.
jwamicha said
July 20, 2007 @ 11:08 am Hello Sreenivas, Sorry for taking so long to get back to you. I havent tried this yet but probably go to your red5 server directory and do an #ant war Grub the created war and drop it inside the tomcat webapps directory. Will try this out this weekend and report on the exact steps. Reply
40.
jwamicha said
July 29, 2007 @ 8:29 am For tomcat everything is exactly as above but the command is: #ant webwar Reply
41.
jwamicha said
July 29, 2007 @ 8:38 am Grab the red5.war from the following path: red5_server/dist/red5.war Reply
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
19/38
24/4/2014
42.
snowman said
August 23, 2007 @ 2:48 pm Hey, thank you for this cool tutorial, I like it, but, the links dont work I cant download red5java.tar.gz. The first link never even loads and the second one has a small hiccup :S Reply
43.
Ambrosios said
September 2, 2007 @ 10:47 am Interesting Reply
44.
Kris said
September 12, 2007 @ 11:00 am Cool Reply
45.
Titos said
September 14, 2007 @ 10:10 pm Cool Reply
46.
Rafa said
September 15, 2007 @ 8:22 pm Hi,
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
Thank you for this great tutorial, pretty valuable for a flex / red5 beginner.
20/38
24/4/2014
Thank you for this great tutorial, pretty valuable for a flex / red5 beginner. Everything works as expected, but im having troubles calling the remote shared object handler method from Flex, - When first connected, calling TSOHandler.sendMessage(..) from Flex gets registered in red5 log, but tsoOnSync event handler never gets called in Flex. - If I disconnect from the server and reconnect, subsequent calls dont even get logged in Red5. Everything goes fine by using NetConnection.call instead. Any clue about this? Is there any performance penalty for using the NetConnection call method instead of the SharedObject method? Thanks in advance Reply
47.
Rafa said
September 16, 2007 @ 8:07 pm Hi, Seems the second issue has been solved in Red5 trunk. The room scope was not being stopped when the last client exited the room although my shared object was being properly freed. Since i was creating this shared object at roomStart handler which was never fired again -since from servers point of view the room actually was running-, i was getting a null reference to the SO. Now its (apparently) fixed. First issues still driving me mad. Thank you. Reply
48.
Yawei said
September 20, 2007 @ 4:56 pm This is a great article. Can anybody email me the sample codes? I cant download them. Thanks a lot. Reply
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
21/38
24/4/2014
49.
Yawei said
September 20, 2007 @ 4:56 pm my email [email protected] Reply
50.
51.
52.
53.
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
22/38
24/4/2014
54.
Ed said
December 5, 2007 @ 8:03 pm Hey jwamicha, I think you accidentally left something out that you meant to include (and its the very thing that I am looking for). In this part: e) build.xml: This is the file that we will use to compile our application before restarting red5. You may use this example build file to compile/build for your own custom applications. Modify the following parameters as appropriate: In our case it was red5java.jar and so we have: There is nothing after the two colons. (And then it just goes on to the next topic). I even checked the underlying html and there are just empty code tags (as if you were going to paste it in there). That code is what I need. Can you please fill in these two empty spaces? Thanks so much. Reply
55.
56.
cezar said
April 16, 2008 @ 5:38 pm Hi, This is a great article. Can anybody email me the sample codes? I cant download them. Thanks a lot. Reply
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
23/38
24/4/2014
57.
Thomas said
May 28, 2008 @ 11:36 pm hello, can anybody hosts the sample-files on rapidshare or megashare or other fileshares. thank you. Reply
58.
jwamicha said
May 29, 2008 @ 10:54 am The files can now be downloaded from here: http://www.thelinkup.com/SharedPage.aspx?vpath=fyw0ogo7twc0 Reply
59.
Varley said
August 20, 2008 @ 5:36 am I have two problems 1) For this tutorial, I cant get the client to connect to the server. > Connection to rtmp://localhost/red5java closed. 2) However, I have been able to connect with the simple demo example (which adds two numbers). The problem is that it never returns the sum. Im using red5 0.7, Ubuntu 8.04. Java 1.6.0. Note: I can get the SOSample to work. Also I am restarting red5 whenever I make modifications to red5java. Reply
60.
Jason said
September 30, 2008 @ 2:57 am Can anyone else repost the files pretty please? http://www.thelinkup.com/SharedPage.aspx? vpath=fyw0ogo7twc0 is not working.
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
24/38
24/4/2014
Reply
61.
jwamicha said
September 30, 2008 @ 7:15 am Sorry. The files are now back on mediafire. Reply
62.
Oliver said
October 17, 2008 @ 1:36 pm Hi, I ran into the same problem Varley described. I can not connect to the red5 server. In the flex GUI I get the message: Connection to rtmp://localhost/red5java closed. and in my red5 error log I find: 2008-10-17 12:29:58,648 [DefaultQuartzScheduler_Worker-1] WARN o.r.server.net.rtmp.RTMPConnection Closing RTMPMinaConnection from 127.0.0.1 : 33247 to localhost (in: 3467 out 3215 ), with id 3784466 due to long handshake I use Red5 0.7 on Slackware 10.1 with JDK 1.6. I saw these kind of problem before with the demos from red5 installation. Here I needed to install the single demos using the link on the start page of red5. After that installation the demos worked (see current red5 FAQ). Any idea? Reply
63.
Oliver said
November 3, 2008 @ 4:25 pm On my second try or view I must say a great tutorial, that shows many of the great features of red5. I tried several versions from red5, but I only had success with red5-0.6.3. So I recommend to use this version with this tutorial. My final successful environment:
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
25/38
24/4/2014
My final successful environment: Client (Windows XP SP3) - Flex Builder 3 (60 Trial from Adobe) Server (Slackware Linux 2.4.29) - Red5 V0.6.3 (build with ant) Thanks, Oliver Reply
64.
prashant said
November 7, 2008 @ 9:41 am Hi, i build the application with eclipse and flex but when i debug build.xml it gives following error messages. C:\Program Files\Red5\webapps\red5java\red5java\WEB-INF\build.xml:38: Includesfile C:\Program Files\Red5\webapps\lib\library.properties not found. Reply
65.
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
26/38
24/4/2014
66.
deepak said
March 3, 2009 @ 11:33 am Hi, I want to streaming audio and video on red5 open source flash media server so any body can help me on this. thanks Deepak Reply
67.
m hewedy said
March 12, 2009 @ 3:19 pm Great, thank you . Reply
68.
salvatore said
March 22, 2009 @ 3:00 am hi, this is a very great post. thanks. I have a problem when i try to connect client, the connection io ok but when i try to get a playlist i recive the message Connection to rtmp://localhost/red5java closed. why? ill be crazy Reply
24/4/2014
69.
Vardan said
April 20, 2009 @ 4:04 pm Hi Joseph, Thanks for the tutorial. One question, quite easy to stream from file directory(/streams) but is it possible to stream a flv not from custom/directory(streams) but from db directly lets say MySQL Blob object. Also is it possible to stream a video straight into VideoDisplay object using BlazeDS+Tomcat+Java+Flex rather than using HttpService call? Thanks again for this great article. Reply
70.
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
28/38
24/4/2014
71.
Poon said
June 29, 2009 @ 6:54 am A good example. It does not compile and run on Red5 0.7 or 0.8 release any more. Is there any chance you may have this fix up? I can help if you need me to. Reply
jwamicha said
June 29, 2009 @ 7:55 am Hi Poon, If you can help me fix this up, I would be grateful. I havent looked at red5 in very long. Thanks Poon. Ive also been putting this off for too long; Ill take a thorough look at the current red5 release (the red5 team have been tireless and have done an excellent dev job on red5 with many new features since this tutorial was made) and update this tutorial with anything new I may find, in the coming weeks. Reply
Poon said
July 12, 2009 @ 7:46 am Here is an updated version of red4java code that compiles and runs on latest Red5 0.8.0 trunk code (rev 3700). Not all client functionalities are working jet. I also notice some strange behavior. You can download the updated code here: http://public-misc.s3.amazonaws.com/red5java-20090711.zip The changes are as follow: Since Red5 0.7.0, Red5 switched from log4j to slf4j. I decide to stay with Red5 native logger instead of using a separate logger. As a result, all loggers instantiation code in *.java has to be changed. In addition, all logger config in *.xml are also updated. Ant build file is updated to use the new logger jar file. In addition, the scripts.properties and lib.properties in Red5 6.x are no longer there.
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
29/38
24/4/2014
72.
73.
jwamicha said
July 13, 2009 @ 10:51 am Hi Poon, Many thanks for the updated/corrected code! Updated tutorial coming soon, as soon as I finish off some pending tasks. Niraj, are you able to connect to red5 using the example demos? Reply
74.
Porno said
September 17, 2009 @ 3:17 pm long paraghraphs are very exhaustingand hard to read Reply
75.
Arash said
30/38
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
24/4/2014
January 2, 2010 @ 9:45 am Hi, Thanks for the article Im from Iran ( Green Power of Iran ) Could you pleas help me? my final project is : replace flash media server with red5 server (project is Video Conference) my asc code is: application.onAppStart = function() { application.users_so = SharedObject.get(users_so, false); application.clearStreams(/); application.speaker=condidate; application.users_so.data= ; application.nextId = 0; } application.onConnect = function(newClient, name) { newClient.name = name; newClient.id = u + application.nextId++; application.users_so.setProperty(newClient.name, name); application.acceptConnection(newClient); newClient.call(receiveID, null, newClient.id, newClient.name); newClient.call(startPlaying,null,application.speaker); newClient.PlayVideo = function(speakerName) { application.users_so.send(PlayVideo,speakerName); } newClient.ReqSpeakAll=function(voterName,voterID){ if(application.clients[i].name==condidate){ application.clients[i].call(ReqSpeakAll,null,voterName,voterID); } } } newClient.AcceptSpeakAll=function(voter1){ } newClient.StopSpeak=function(voter1){ } newClient.acceptStopSpeak=function(){ application.speaker=condidate; application.users_so.send(speaking, application.speaker); } } if (client.name==condidate){ application.speaker=condidate; for(var i=0;i<application.clients.length; i++){
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/ 31/38
24/4/2014
76.
Candice said
February 4, 2010 @ 2:21 pm Hi! Thanks for your post. Its been helpful BUT with every application that I try to create or even already created sample applications (including yours), I get the same error when starting the server. EVERYTIME!!!! This is the error I get: Exception in thread Launcher:/videoDemo java.lang.RuntimeException: Failed to load webapplication context class. at org.red5.server.tomcat.TomcatLoader$1.run(TomcatLoader.java:531) Caused by: java.lang.ClassNotFoundException: org/springframework/web/context/support/XmlWebApplicationContext at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.red5.server.tomcat.TomcatLoader$1.run(TomcatLoader.java:528) Since I get the same error for every application, Im guessing the problem is more with my configuration of the server or something, as opposed to a xml files problems. CAN YOU PLEASE PLEASE HELP ME?!?!? Im desperate!!!! Thank you! Candice Reply
Daniel said
May 26, 2010 @ 9:26 pm I also have this problem. Any solution? Reply
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
32/38
24/4/2014
dadasign said
March 18, 2011 @ 11:54 pm Ive also lost some time searching for a solution to the Failed to load webapplication context class. And while this might not be a satisfactory answer to the problem removing: log4jConfigLocation /WEB-INF/log4j.properties and org.springframework.web.context.ContextLoaderListener solved the problem and allowed me to run my application. I hope this helps. Reply
77.
ChrisPhotonic said
June 16, 2010 @ 9:51 pm Hello, I found this guild while trying to get the red5recorder (simple red5 flash application that can record from a video camera to the server) working. I dont see anything called WEB-INF in his download zip. I see he also charges 400 pounds for an install which is probably a 5 minute deal if there were any kind of install instructions or documentation. Is this guy trying to lead everyone off the path to get everything working? Ive never added anything flash into my site a couple days ago. Im looking to go though your setup process on his source package, which seems to be missing the server configuration files. I was wondering if you had installed red5recorder before, and if you and any tips for someone just starting out, or even if you could point me in the right direction. Thanks! -Chris Reply
jwamicha said
June 17, 2010 @ 8:09 am
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/ 33/38
24/4/2014
Hi Chris, Its been about 2 years since I last used red5. You would need to compile the red5recorder.mxml (and maybe BlinkApp.mxml?) into an .swf file for the website. You could try using ant and the build.xml file in red5_flexclient for a build example. Good luck! Reply
78.
79.
80.
goodpays.me said
January 3, 2013 @ 2:34 am CREATE NEW JAVA RED5 APPLICATION Tsavo was indeed a great blog. If merely there was even more personal blogs just like this amazing one in the web. Regardless, thank you for ur time, Jamel Reply
81.
http://tinyurl.com/oukaeasy32546 said
January 17, 2013 @ 9:07 pm
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
34/38
24/4/2014
This excellent blog, CREATE NEW JAVA RED5 APPLICATION Tsavo shows the fact that u actually understand exactly what u r communicating about! I really absolutely am in agreement. Thank you -Stephanie Reply
82.
Isobel said
January 29, 2013 @ 10:17 pm constantly i used to read smaller articles or reviews that also clear their motive, and that is also happening with this article which I am reading here. Reply
83.
Minna said
February 23, 2013 @ 6:21 pm Dwight Freeney, who was simply supposed to leave Indianapolis, spent 11 years using the Colts and while using exception of Reggie Wayne (who beats him by one year), was the longest tenured Colt. She deserved a photo, he said. The commercial success of Banksy prints allows the artist to search the globe and build political works highlighting issues in post-hurricane Katrina New Orleans, the Barcelona Zoo as well as the West Bank barrier separating Palestine from Israel. Reply
84.
www.youtube.com said
June 2, 2013 @ 10:18 am I have been exploring for a little for any high quality articles or blog posts in this kind of area . Exploring in Yahoo I at last stumbled upon this website. Reading this info So im glad to convey that I have a very good uncanny feeling I came upon exactly what I needed. I such a lot surely will make certain to don? t put out of your mind this site and give it a glance on a constant basis. Reply
85.
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
24/4/2014
July 15, 2013 @ 11:55 am All they need to do is to enroll with their name, email, contact number and country and vemmabuilder will cater to the particular country of the person. It wont take you extremely long to work out what way to employ it. The specific combination of reps, sets, exercises, and weight depends upon the desires of the body builder. Reply
86.
87.
88.
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
36/38
24/4/2014
89.
90.
91.
92.
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
37/38
24/4/2014
customers, too, because you typically need to send different information to the different groups. Decide now because if you are a weight lifter, you will not build the chest that you are looking for. Reply
93.
said
April 17, 2014 @ 7:37 am Hi to every single one, its in fact a good for me to pay a visit this site, it contains useful Information. Reply
94.
Barbra said
April 22, 2014 @ 1:29 pm Hey! Someone in my Facebook group shared this website with us so I came to look it over. Im definitely enjoying the information. Im bookmarking and will be tweeting this to my followers! Superb blog and excellent design and style. Reply
RSS (Really Simple Syndication) feed for comments on this post TrackBack URI (Uniform Resource Identifier)
Follow Tsavo
Powered by WordPress.com
http://jwamicha.wordpress.com/2007/01/29/create-a-new-java-red5-application/
38/38