Posts Tagged eclipse

BEGIN RED5 DEVELOPMENT

[NOTE: Please replace the paths with your own directory structure for this tutorial]

CHECKOUT RED5 TRUNK INTO ECLIPSE – RED5 SERVER
Checkout red5 if you have reliable bandwidth.
1. Install subclipse. Instructions are on the following URL:
http://subclipse.tigris.org/install.html

2. Set up red5 on eclipse using the wink tutorial on the following URL:
http://www.bluetube.com/clients/red5/eclipse.htm
The red5 dev repository is:
http://svn1.cvsdude.com/osflash/red5/java/server/trunk

3. Right click on the red5 repository above, click on Checkout to checkout the code. The red5 sources will be copied to your workspace directory. In addition, a new java project will be automatically created.

4. You will now have checked out the red5 code and can immediately begin working on it.

Alternatively if your bandwidth is poor, you may download the red5 sources of your choice from the following link:
http://www.osflash.org/red5/red5downloads
Untar these sources, then continue on with the steps below:

CREATE NEW RED5 PROJECT IN ECLIPSE
1. Then navigate to File > New > Project. Call it say red5server

2. Right click on the red5server project link and select Import > File System. Navigate to the location of the untarred red5 sources folder. Select this folder and click on Finish to create your new Red5project.

INSTALLING FLEX2 ON LINUX
Why do we need flex2? We need flex2 to development the Flash Client User Interface that will be connecting to our Red5 server in order to play streams. Flex2 sources can be compiled on linux.

1. Download the flex2 SDK (flex_sdk_2.zip) from Adobe
http://www.adobe.com/cfusion/tdrc/index.cfm?product=flex
However, you need to be logged in first.

2. Then follow the steps below(Note: you might choose to create your flex2sdk directory in a different location):

#mkdir /home/sysadmin/flex2sdk
#cd /home/sysadmin/flex2sdk
#unzip /home/sysadmin/Downloads/flex_sdk_2.zip
#vim /usr/bin/mxmlc

Paste the following 2 lines inside:

#!/bin/sh
/home/sysadmin/flex2sdk/bin/mxmlc

Then…
#chmod 755 /usr/bin/mxmlc

You should now be able to compile flex2 source off the command line

EDITING FLEX2 CODE USING VIM
1. Download the actionscript vim file from the following link:
http://geocities.com/manish_jethani/actionscript.vim

2. Follow the steps below:

#dos2unix /home/sysadmin/Downloads/actionscript.vim
#cd /home/sysadmin/Downloads/
#cp actionscript.vim /usr/share/vim/current/syntax/
#vim /usr/share/vim/current/filetype.vim

Remove the *.as from the entry for the Atlas language
Then add the following 2 lines to the same file:

” Actionscript
au BufNewFile,BufRead *.as setf actionscript

Now,
#vim /etc/vimrc
Append the line below to the vimrc file:
syntax on

You should now be able to edit *.as files on vim.
3. Since *.mxml are xml files, syntax highlighting for these files will be on by default.

INSTALLING ECLIPSE WTP
1. Download Eclipse WTP (for J2EE web application development) from the following link:
http://download.eclipse.org/webtools/downloads/
Look for the wtp all in one sdk and download it, as it comes with all the required pre-requisites.

2. Untar the all in one wtp sdk.
#cd /home/sysadmin/Downloads
#mkdir wtp
#tar -xzvf wtp-all-in-one-sdk-*-linux-gtk.tar.gz —directory wtp

3. Create a folder (if it doesn’t exist already) called links in your eclipse installation path. So in my case I did this:
#mkdir /opt/eclipse/links

3. #vim /opt/eclipse/links/wtp.link
(Append the following line ie the path to your untarred wtp sdk folder)
path=/home/sysadmin/Downloads/wtp/eclipse

4. Now restart eclipse. The wtp plugin should have been installed. To remove the WTP plugin just remove the wtp.link file in your links directory above.

INSTALL SPRING ECLIPSE IDE
Red5 is written using the Spring Framework so to do server side logic code it would help a great deal to have this plugin installed. Red5 uses Spring to perform Dependency Injection (DI) by using Spring’s IoC (Inversion of Control) container. This allows you to custom configure red5 (with your own personal dependencies) without having to alter/modify the core red5 api. In addition, Spring comes with plenty of functionality and features that you can use for your server-side logic. When using Spring’s IoC container, try us much as possible to decouple the IoC container from your actual source code. Please follow the steps below to configure the Spring Eclipse IDE:

1. Download the spring ide eclipse plugin from the following URL:
http://springide.org/updatesite/

2. unzip it:
#cd /home/sysadmin/Downloads
#mkdir spring
#mv springide_updatesite_*.zip spring
#cd spring
#unzip springide_updatesite_*.zip

3. Add the plugin to Eclipse. A warning is given not to copy the plugin folders directly into your eclipse installation. You can only use Eclipse’s Update Manager. In Eclipse, navigate to: Help > Software Updates > Find and Install > Search for new features to install. Click on Next.

4. Click New Local Site. Select the folder spring above ie
/home/sysadmin/Downloads/spring

5. Tick the checkbox with spring and click Finish. Follow the installation instructions to completion to install Spring IDE plugin inside Eclipse.

INSTALLING FLEX BUILDER 2 ON LINUX
1. Download Flex Builder 2 from the following link:
http://labs.eshangrao.com/files/FlexBuilder_2.0_Linux_Alpha_0.1.tar.gz

2. Follow these steps:
#mkdir /home/sysadmin/Downloads/FlexBuilder2

In my case, I have eclipse installed in the /opt directory.


#cd /home/sysadmin/Downloads
#mv FlexBuilder_2.0_Linux_Alpha_0.1.tar.gz /opt/eclipse
#cd /opt/eclipse
#tar -xzvf /opt/eclipse/FlexBuilder_2.0_Linux_Alpha_0.1.tar.gz
#cp -Rf configuration plugins
#cp -Rf configuration features
#vim /opt/eclipse/configuration/com.adobe.flexbuilder/flexbuilder2.properties

Edit the line sdk.path=/home/sysadmin/flex2sdk to the path of your flex2 SDK. You should now be ready to start flex2 development on Linux.
Do the same for the following files:

#vim /opt/eclipse/plugins/configuration/com.adobe.flexbuilder/flexbuilder2.properties
#vim /opt/eclipse/features/configuration/com.adobe.flexbuilder/flexbuilder2.properties

3. Start Eclipse (to be sure everything runs ok without any permission errors, run it as root)
#eclipse -clean

4. When Eclipse starts up, you will be asked for your valid Flex Builder 2 Serial Number and Chart Serial Number if you choose to enable it. Enter your Serial Numbers, press ok and you can now run Flex Builder 2 on Linux.


INSTALL ECLIPSE Actionscript Development Tool ON LINUX INSTEAD OF Flex Builder 2

1. Please download and follow the instructions on this link:
http://sourceforge.net/projects/aseclipseplugin/

You may now use vim or eclipse for all red5 development on Linux.

INSTALL FLASHPLAYER 9 FOR LINUX
1. Download Flash9 for Linux from the following link:
http://www.adobe.com/go/getflashplayer

2. Please follow these instructions:
#tar -xzvf /home/sysadmin/Downloads/FP9_plugin_beta_101806.tar.gz
#cd /home/sysadmin/Downloads/flash-player-plugin-9.0.21.55

Now follow the instructions in the readme.txt contained in this directory
(Your directory will be most likely be either /usr/lib/mozilla or /usr/lib/firefox. Try both and see which works for you.)


RED5 FLEX2 SAMPLE PLAYER

1. Download John Grden’s excellent sample player from the following link:
http://www.rockonflash.com/red5/demos/samples/Red5Samples.zip

2. Follow the steps below if you are on Linux:
#unzip /home/sysadmin/Downloads/Red5Samples.zip
#cd /home/sysadmin/Downloads/Red5 Samples

All the player sources are contained therein
Use this player to connect to the red5 oflaDemo streams as you will see below:

3. Open the Red5 Samples folder using either vim or eclipse and then modify the file build.properties and build.xml so we can compile the samples on Linux. Lets begin with build.properties. Edit the following variables:
– launchmethod=ff (make it equal to firefox)
– firefox=/usr/bin/firefox (location of your firefox binary)
– compiler=/usr/bin/mxmlc
– flex2.dir=/home/sysadmin/Downloads/flex2sdk/bin

4. Under the build.xml file change the compile and launchfirefox targets to something that fits your system. Also, comment out the tag: arg line=”-source-path=’C:/Program Files/FlashDevelop/Library'”

5. Increase the detail of red5 logging by modifying the file /conf/log4j.properties. Modify the file conf/log4j.properties under #Demos for the oflaDemo specifically. Change from WARN to DEBUG. In my case the was /opt/red5svn

6. In Eclipse navigate to File > New Project > Flex Project. Give it a name say red5flex.

7. In the Package Explorer to the left of your Eclipse workspace, right click on red5flex and click Import. Then go to General > File System and click Next. Select the location where you unzipped the Red5Samples.zip above. You now have a new flex project in Eclipse.

7. To run, right click on red5flex’s project build.xml (the build.xml file you have just edited above) file and select Run as > Ant Build. The player will open in a new firefox browser window.

8. In the location where you downloaded or checked out red5 server code, run:
#ant server (In my case this was /opt/red5svn. Run this command where build.xml file is in the same directory.) To confirm that red5 has started up ok, navigate to http://localhost:5080/, where you should be able to see the red5 admin panel.
Since logging for the oflaDemo is set to DEBUG, you will be able to see when the player connects to Red5 (using AMF0) and retreives the flv files.
If you have any problems running ant server, please ensure you have SUN’s JDK in your JAVA path. The jdk on my suse box for example doesn’t work for red5 compilation. Download it from the following link:
http://java.sun.com/downloads/

Then put it in your path. Open the file /etc/profile. Append the following text inside:
export JAVA_HOME=/opt/jdk1.5.0_09
export PATH=$PATH:$JAVA_HOME/bin

In my case I installed the jdk in the folder /opt.
Then do:
#source /etc/profile

Now everytime you boot the machine, your $JAVA_HOME variable is set.

If you are running Suse, go to /usr/bin
#cd /usr/bin
#rm java
#ln -s /opt/jdk1.5.0_09/bin/java java

You can now use the latest SUN jdk on your machine.

9. Inside the player that you have just opened in the firefox window, click Connect. In the console where you started ant server you will see the flash client connecting and retreiving information on the flv streams available.

10. Modify John’s flex2 flash client to your liking from here on and everytime you want to test just run ant using it’s build.xml file as shown above.

MAKE YOUR OWN RED5 APPLICATION AND PLUG IT INTO THE RED5 SERVER
1. At this point you should now be ready to follow Joachim’s excellent tutorials on how to do so. Please find them on the following link:
http://www.joachim-bauch.de/tutorials/red5/view

2. To start up red5 run ant server or ./red5.sh or execute red5.bat.


CREATE SAMPLE FLASH PLAYER USING OPEN SOURCE OPENLASZLO

[TODO]

A GOOD READ
1. Red 5 searchable mailing lists:
http://www.mail-archive.com/red5@osflash.org/
http://www.nabble.com/Red5-f16328.html(new)

2. Tomcat:
http://tomcat.apache.org/tomcat-5.5-doc/appdev/deployment.html

3. Beans:
http://www.springframework.org/docs/reference/beans.html#beans-basics

4. Ruby and Groovy with Spring:
http://www.springframework.org/docs/reference/dynamic-language.html

Comments (26)