Red5:服务器应用程序框架和 helloworld

发布于 2025-01-02 05:54:53 字数 143 浏览 0 评论 0原文

任何人都可以为 Red5 应用程序提供更新的应用程序框架吗?据我所知,日志系统从 Log4j 更改而来。我一直在寻找一些教程来设置所有内容,但无法真正找到简单有效的东西。 上瘾了,谁能提供一个关于服务器应用程序和 Flex 客户端的简单教程吗?

提前致谢!

Can anyone provide an updated application skeleton for a Red5 application? From what I have found the logging system changed from Log4j. I've been looking for some tutorials just to setup everything but can't really find something that simply works.
In addiction, can anyone provide a simple tutorial with a server application and Flex client?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

金橙橙 2025-01-09 05:54:53

我为此挣扎了很多。这个参考对我有用:

http://fossies.org/unix/privat/red5-1.0.0-RC2.tar.gz:a/red5-1.0.0/doc/reference/html/logging-setup.html< /a>

技巧是删除所有 log4j.properties 或 log4j.xml 文件,并从 web.xml 中删除所有“log4j”侦听器

创建一个 logback-myApp.xml,其中 myApp 是您的名称webapp 并将其放在您的 webapp 类路径(WEB-INF/classes 或 WEB-INF/lib 内的应用程序 jar 中)中

,我的应用程序是这样的:

import org.slf4j.Logger;
import org.red5.logging.Red5LoggerFactory;

然后:

private static Logger log = Red5LoggerFactory.getLogger(MyClassName.class, "myApp");

客户端操作脚本如下所示:

// Initializiing Connection
        private function initConnection():void{
            nc = new NetConnection();
            nc.client = new NetConnectionClient();  
            nc.objectEncoding = flash.net.ObjectEncoding.AMF0;                  
            nc.connect(rtmpPath.text,true); //Path to FMS Server e.g. rtmp://<hostname>/<application name>

            nc.addEventListener("netStatus", publishStream);    //Listener to see if connection is successful
        }


    private function publishStream(event:NetStatusEvent):void{
        if(nc.connected){
            nsPublish = new NetStream(nc);  //Initializing NetStream
            nsPublish.attachCamera(Camera.getCamera());
            nsPublish.attachAudio(Microphone.getMicrophone()); //Attaching Camera & Microphone
            nsPublish.publish(streamName.text,'live'); //Publish stream
            mx.controls.Alert.show("Published");
        }
        else{
            mx.controls.Alert.show("Connection Error");
        }
    }   

I struggled a lot with that.. This reference worked for me:

http://fossies.org/unix/privat/red5-1.0.0-RC2.tar.gz:a/red5-1.0.0/doc/reference/html/logging-setup.html

The trick was to Remove any log4j.properties or log4j.xml files and Remove any "log4j" listeners from the web.xml

Create a logback-myApp.xml where myApp is the name for your webapp and place it on your webapp classpath (WEB-INF/classes or in your application jar within WEB-INF/lib)

and im my app i did:

import org.slf4j.Logger;
import org.red5.logging.Red5LoggerFactory;

and then:

private static Logger log = Red5LoggerFactory.getLogger(MyClassName.class, "myApp");

the clients actionscript looks like this:

// Initializiing Connection
        private function initConnection():void{
            nc = new NetConnection();
            nc.client = new NetConnectionClient();  
            nc.objectEncoding = flash.net.ObjectEncoding.AMF0;                  
            nc.connect(rtmpPath.text,true); //Path to FMS Server e.g. rtmp://<hostname>/<application name>

            nc.addEventListener("netStatus", publishStream);    //Listener to see if connection is successful
        }


    private function publishStream(event:NetStatusEvent):void{
        if(nc.connected){
            nsPublish = new NetStream(nc);  //Initializing NetStream
            nsPublish.attachCamera(Camera.getCamera());
            nsPublish.attachAudio(Microphone.getMicrophone()); //Attaching Camera & Microphone
            nsPublish.publish(streamName.text,'live'); //Publish stream
            mx.controls.Alert.show("Published");
        }
        else{
            mx.controls.Alert.show("Connection Error");
        }
    }   
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文