Sunday, March 21, 2010

AS3 and Red5

There seem to be not enough documentation about Red5 and AS3, especially on properly creating a new application, so I thought of writing one.

SOSampleAS3 is a simple Remote SharedObject demo app.The code is a modified Red5's SOSample demo which was written in Adobe Flash IDE and AS2. This is written in pure AS3 on FlashDevelop. Also, it demonstrates remote call using Shared Fridge Magnet tutorial.

How to install the demo webapp?

  1. Extract SOSampleAS3.zip.
  2. Then extract SOSampleAS3-src.zip.
  3. Copy bin directory to C:\Program Files\Red5\webapps\root so it will be:
    • C:\Program Files\Red5\webapps\root\bin\
    • C:\Program Files\Red5\webapps\root\bin\expressInstall.swf
    • C:\Program Files\Red5\webapps\root\bin\index.html
    • C:\Program Files\Red5\webapps\root\bin\SOSampleAS3.swf
    • C:\Program Files\Red5\webapps\root\bin\js\swfobject.js
  4. Extract SOSampleAS3-webapp.zip.
  5. Copy SOSampleAS3 directory to C:\Program Files\Red5\webapps so it will be:
    • C:\Program Files\Red5\webapps\SOSampleAS3\
    • C:\Program Files\Red5\webapps\SOSampleAS3\META-INF\MANIFEST.MF
    • C:\Program Files\Red5\webapps\SOSampleAS3\WEB-INF\classes\org\red5\server\webapp\elcMagnets\Application.class
    • C:\Program Files\Red5\webapps\SOSampleAS3\WEB-INF\lib\elcMagnets.jar
    • C:\Program Files\Red5\webapps\SOSampleAS3\WEB-INF\red5-web.properties
    • C:\Program Files\Red5\webapps\SOSampleAS3\WEB-INF\red5-web.xml
    • C:\Program Files\Red5\webapps\SOSampleAS3\WEB-INF\web.xml
  6. Restart your Red5 Server.
  7. Open your browser and set address to http://localhost/bin/.

That's it!

11 comments:

mike said...

Thanks a lot !

creek23 said...

No problem. Glad I could help. ;)

Anonymous said...

hey creek i am facing so much problems in running a basic red5 application, i follow the process but the output is that "..InvalidApp"

creek23 said...

what particular version of Red5 are you using?

Anonymous said...

I am using red5.0.7 version

creek23 said...

Isn't that a bit too old? Can you try 0.9.1 instead?

Anonymous said...

hey i m trying the same as like you, but it doesn't work appropriately.

Anonymous said...

thank you

AbodoChickenMania said...

hi, have you tried playing a simple video through rtmp from a folder in red 5 server on your local machine ?.
simlar to the ofla_demo .

creek23 said...

Hi Aditya,

I only got to stream a webcam feed.

Anonymous said...

Hi,

I tried to run this app and I get Scope SOSampleAS3 not found on localhost, then it says closing RTMPMinaConnection due to long handshake?
I've got Red5 1.0.1 and followed your instructions, copying folders to the right places etc.

Any suggestions?