RtmpRed5Webapp
From OpenLaszlo
Contents |
Introduction
Red5-Sample WebApp Description
Resources
Source and Binary: http://downloads.laszlo-forum.de/red5OpenlaszloSampleWebapp.zip
Installation
- Install Red5 from http://www.osflash.org/red5
- Download http://downloads.laszlo-forum.de/red5OpenlaszloSampleWebapp.zip
- unzip red5OpenlaszloSampleWebapp.zip
- red5OpenlaszloSampleWebapp.zip contains a folder *webapp*
- webapp* contains a folder *laszlotest* copy *laszlotest* and its content from *webapp* to $RED_HOME/webapps
- (re)start Red5
- copy the test-lzx File from red5OpenlaszloSampleWebapp/laszlo/main.lzx into your openlaszlo server
- alter the connection url of the rtmpconnection in main.lzx from *macbook* to point to your Red5-HostName
- run main.lzx in your browser (swf7/swf8)
MainTests
- Function: methodWithoutParams call a simple server side function without any params, (works)
- Function: methodWithObjectArray call a simple server side function with one param, (does not work => LPP-4218)
- Function: methodWithMultipleParams call a simple server side function with multiple params, (does not work => LPP-4218)
- Function: invokeClientFunctions calls a server side function with one param (does not work)
- in Application.java the Method invokeClientFunctions pushes a Message to all Connected clients (of the current scope) to the Method *newMessage* (does not work => LPP-2554)
- newMessage in Application.java has a Callback handler (public void resultReceived(IPendingServiceCall call)) this should receive the result of the pushed Method-Call of *newMessage* (does not work => LPP-4220)
- Function: testMethod calls a server side Function in ServiceTesthandler.java (not the default web.handler) (works)
Configuration of webapp
- the root key of the webapp =>$RED5_HOME/webapps/laszlotest/WEB-INF/red5-web.properties the param: webapp.contextPath=/laszlotest
- web.handler => Application.java => this handler receives all Method call by default, it is defined in $RED5_HOME/webapps/laszlotest/WEB-INF/red5-web.xml
<bean id="web.handler" class="org.openlaszlo.red5.testapp.Application" singleton="true" />
org.openlaszlo.red5.testapp.Application extends the Red5-ApplicationAdapter Class (see http://dl.fancycode.com/red5/api/org/red5/server/adapter/ApplicationAdapter.html )
- custom Service-Handlers ServiceTesthandler.java
defined in $RED5_HOME/webapps/laszlotest/WEB-INF/red5-web.xml
<bean id="myhandler.service" class="org.openlaszlo.red5.testapp.ServiceTestHandler" singleton="true" />
Red5 rtmpt
see:LPP-4219
To alter the port settings of Red5 (for rtmp and rtmpt) see:
$RED5_HOME/conf/red5.properties
rtmp.port=1935
rtmpt.port=8088
Altering the webapp server side code
red5OpenlaszloSampleWebapp.zip is an eclipse project. It has no external dependencies. Necessary jar-files are included. You will need Java-Version 1.5 to run and compile it. To compile the Sources you must include the jars from the lib directory. The webapp is already compiled, if you alter something all you need to do is to export the content of the red5OpenlaszloSampleWebapp(.zip)/src/app/ into a JAR file (laszlotest.jar) and replace the one in: $RED_HOME/webapps/laszlotest/WEB-INF/lib and restart the server.
Links and more Examples
- some simple broadcast and subscribe appz: http://code.google.com/p/openmeetings/wiki/SimpleSampleApps

