Virces wrote:
> i've took a look at Video Conference sample of Red5 but i don't
> understand how it works. Anybody can show me how it all links together ?
> Is there any step by step tutorial show how to stream video from a webcam ?
> If not, i wish somebody can help me.
>
> thanks alot
1. Go to {Red5dir}/webapps and find a test fold there (actually, you can
use any other).
2. Copy and paste it right into the same directory (so it should have
name of test copy or smth similar). Rename it to whatever you want your
app to be called, say, I want my next app to be called "streamer".
3. Open up Eclipse (or any other IDE you prefer but Eclipse seems to be
the de facto standart among open source development environments).
4. Create a new Java project (if you don't know how to do this go to
Help > Help contents > JDT section and read the basics).
5. Right click it and select New > Folder. Click Advanced. Check up
checkbox at the bottom indicating you want a link to that directory.
Select {RED5}/webapps/streamer/WEB-INF when Choose Folder dialog appears.
6. WEB-INF folder should be attach to your project. Open up three files
in it. These are web.xml, red5-web.xml and red5-web.properties
red5-web.properties looks like this
webapp.contextPath=/app_name
webapp.virtualHosts=localhost, 127.0.0.1
change the first line to
webapp.contextPath=/streamer
and configure virtual hosts to whatever you need run server at, for
localhost use
webapp.virtualHosts=localhost, 127.0.0.1
In red5-web.xml find the following bean definition:
<bean id="web.handler" class="blah-blah-blah" singleton="true">
and change it to, say,
<bean id="web.handler"
class="com.somedomain.red5.apps.streamer.Application" singleton="true">
where class points to you application main class.
And in web.xml change
<display-name>Test</display-name>
to
<display-name>streamer</display-name>
and
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>/test</param-value>
</context-param>
to
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>/streamer</param-value>
</context-param>
7. Right click on project in Project Explorer view in Eclipse, choose
New > Source folder. Call it source. Then right click your project,
select Properties, then Java Build Path > Libraries and use Add
External Jar button to add red5.jar and commons-logging.jar from {RED5}/lib.
8. Right click on it and choose New > Package. Call it
com.somedomain.red5.apps.streamer (remember full class name that you
specified for web handler bean's class attribute).
9. Right click your brand new package and choose New > Java Class.
Call it Application, parent class should be
org.red5.server.adapter.ApplicationAdapter
10. Leave the class alone. Now right click on your project, choose
Export > Java > JAR file. Click Next. Diselect all files in project root
(we don't need them in our app jar). Check Export generated class files
and resources and Compress the contents of the JAR file, uncheck others.
Then export your JAR to {RED5}/webapps/streamer/WEB-INF/lib as
streamer.jar and start up the server.
Go to {RED5}/bin and call wrapper.exe -c ../conf/wrapper.conf
And no need to user ant server task to rebuild Red5 before each start.
11. Client code:
var nc:NetConnection = new NetConnection();
nc.onStatus = function( status:Object )
{
trace( "Status code is " + status.code );
}
nc.connect( "rtmp://localhost/streamer" );
If you're familiar with Ant I can post my Ant buildfile here. You would
need to specify RED5 location and path to necessary libraries you want
to use in your app. Then your compilation, export and copying will be
done with a double click in Ant view in Eclipse.
--
Michael "Antares" Klishin,
http://www.novemberain.com || mailto:[EMAIL PROTECTED]
"We are able to enable people to use Flash where it's useful. It's not
all or nothing. You can mix and match."
-- Kevin Lynch
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org