2012-02-02 9 views
1

誰もRed5アプリケーション用に更新されたアプリケーションスケルトンを提供できますか? Log4jからロギングシステムが変更されました。私は、すべてをセットアップするためのチュートリアルを探していましたが、単純に機能するものを実際に見つけることはできません。 中毒では、誰もサーバーアプリケーションとFlexクライアントで簡単なチュートリアルを提供できますか?Red5:サーバーアプリケーションのスケルトンとhelloworld

ありがとうございます!

答えて

0

私は...このリファレンスは、私のために働いたことで多くの苦労:

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

をトリックがどのlog4j.propertiesかのlog4j.xmlファイルを削除してから、任意の「log4jの」リスナーを削除しましたweb.xmlの

て、myAppは、Webアプリケーションの名前ですlogback-myApp.xmlを作成し、Webアプリケーションのクラスパス上に置きます(WEB-INF WEB-INF/libに内/クラスやアプリケーションのjarファイル内)

と私のアプリ私はやった:

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

、その後:

// 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"); 
     } 
    } 

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

クライアントのActionScriptは次のようになります