Hello,

I have small .swf publishing a webcam-video
and then playing it right back to the same user:

    function updateStatus(info) { status_txt.text += info.level + ': '
+ info.code + newline; }

    var camera:Camera = Camera.get();
    var micro:Microphone = Microphone.get();

    local_video.attachVideo(camera);
    nc = new NetConnection();
    nc.onStatus = updateStatus;

    nc.connect("rtmp:/myapp");
    status_txt.text += nc.uri + newline;

    publish_ns = new NetStream(nc);
    publish_ns.onStatus = updateStatus;
    publish_ns.attachAudio(micro);
    publish_ns.attachVideo(camera);
    publish_ns.publish("live_test");

    play_ns = new NetStream(nc);
    play_ns.onStatus = updateStatus;
    remote_video.attachVideo(play_ns);
    play_ns.play("live_test");

To make it work with FMS2, I just need
to create a new subdir "myapp" in the
"c:\Program Files\Macromedia\Flash Media Server 2\applications"

1) What would be please needed to do the
    same with Red5? I've tried copying the
    doc\templates\myapp into webapps and replacing

    <bean id="web.handler"
          class="the.path.to.my.Application"
          singleton="true" />
    by:

    <bean id="web.handler"
          class="org.red5.server.adapter.ApplicationAdapter"
          singleton="true" />

   But this doesn't work - I get
  "error: NetConnection.Connect.Failed" and:

[DEBUG] 115246 IoWorker-4:( org.red5.server.Server.debug ) Check host
and path: /myapp
[DEBUG] 115246 IoWorker-4:( org.red5.server.Server.debug ) Check
wildcard host with path: /myapp
[DEBUG] 115246 IoWorker-4:( org.red5.server.Server.debug ) Check host
with no path: /
[DEBUG] 115246 IoWorker-4:( org.red5.server.Server.debug ) Check
default host, default path: /
[DEBUG] 115246 IoWorker-4:( org.red5.server.BaseConnection.debug )
Close, not connected nothing to do.
[DEBUG] 115246 IoWorker-4:( org.red5.server.BaseConnection.debug )
Close, not connected nothing to do.

     (Probably because the corresponding handler method
       (which is it?) in the base class ApplicationAdapter
      does nothing?)

2) When I replace the call in my flash movie to use
    some non-empty application, like "webapps\test":

            nc.connect("rtmp:/test");

    then publishing and playing works as expected.

    However I'm worried about non-authorized hot-linking
    to that link. What method in the ApplicationAdapter
    should I overwrite, so that I could call it like these:

           nc.connect("rtmp:/test", "my_secret_password");

    and reject connections in my application who use
    a wrong password? (I realize, that this is not secure,
    because the password can be read out of the .swf.
    Later I'd like to replace it by some database code...)

Thank you in advance and sorry if my questions
are dumb - I'm not very fluent in Java.

Regards
Alex


-- 
http://preferans.de

_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to