== Red5Install/OpenLaszlo ==
* 2011.10.8
 * svn co http://svn.openlaszlo.org/openlaszlo/trunk/test/video/
 * lps-4.7.1/Server/lps-4.7.1/video/example-rtmpconnection.lzx
{{{#!vim
}}}
  * url ÀÇ °æ·Î Á¡°Ë ÇÊ¿ä
* 2011.10.2
* openlaszlo demo videolibrary
* videolibrary.lzx
 * canvas
  * include
{{{#!vim
    
    
    
    
    
    
    
    
    
    
    
    
    
}}}
  * dataset ds_library
  * method makeNewVideo
  * method doneRecording
  * rtmpconnection id="rtc"
  * videolibraryplayer
   * id="vp" name="vp" width height type="rtmp"
   * videomaker="${canvas}"
   * visible="${rtc.stage == 2}"
  * text
  * debug
* 
 *  ...
 * 
 * 
 * 
 * 
  * components/av/videolibrarypopup.lzx
* 
 *  ...
 * 
 * 
 * 
 * 
 * 
* 
  *  
   * cam, mic, opened, topHeight, openWidth, videomaker
  *  
   * 
  * 
  * 
  * 
   * 
    * 
   * 
  * 
  * 
   * 
   * 
  * 
  * 
   * 
   * 
   * 
  * 
  * 
  * 
  * 
 * 
* 2011.9.30
* synaptic
 * red5-server
 * subversion
 * flashplugin-nonfree
  * http://wiki.kldp.org/wiki.php/Red5Install/FlashInstall
  * reboot
 * sun-java6-jdk
  * update-alternatives --config java
* http://www.openlaszlo.org/archive
 * 4.7.1
 * edit .bashrc
  * insert export JAVA_HOME=/usr/lib/jvm/java-6-sun
  * source .bashrc
* red5-0.9.1.tar.gz
 * red5 index.html
 * red5-server restart
 * click install
 * select item -> install box click
 * ¿À·ù°¡ ¹ß»ýÇÒ ¼ö ÀÖÀ½. 
 * ´Ù½Ã ¼³Ä¡¸¦ ÇÏ·Á¸é, ¼³Ä¡µÇ¾ú´Ù´Â ¿À·ù ¸Þ½ÃÁö°¡ ³ª¿È.
* manually install
 * svn co http://red5.googlecode.com/svn/java/server/tags/0_9_1 red5-0.9.1.svn
 * svn co http://red5.googlecode.com/svn/java/example/trunk red5-examples/
 * cd red5-examples/
 * cp -R oflaDemo ../red5-0.9.1.svn/webapps/
 * cd ../red5-0.9.1.svn/webapps/oflaDemo
 * export RED5_HOME=/usr/share/red5
 * ant
 * as root
 * cp -r www /usr/share/red5/webapps/oflaDemo
 * find . -type d -exec chown _red5 {} \;
 * /etc/init.d/red5-server restart 
=== openlaszlo ===
{{{#!vim
}}}
* log
{{{#!vim
2011-09-30 16:40:55,737 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:session x-event:connect c-ip:127.0.0.1 c-client-id:26
2011-09-30 16:40:55,737 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - oflaDemo appConnect
2011-09-30 16:40:55,737 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.Application - appConnect: RTMPMinaConnection from 127.0.0.1 : 41566 to localhost (in: 3416 out 3073 )
2011-09-30 16:40:55,738 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.Application - appJoin: Client: 26 >> [WebScope@e05ad6 Depth = 1, Path = '/default', Name = 'oflaDemo']
2011-09-30 16:40:55,738 [NioProcessor-1] INFO  org.red5.server.jmx.JMXFactory - Object name: org.red5.server:type=RTMPMinaConnection,connectionType=persistent,host=localhost,port=1935,clientId=26
2011-09-30 16:40:55,801 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:play c-ip:127.0.0.1 x-sname:0e28cc30-b954-477d-9330-75042add946d
2011-09-30 16:40:55,806 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:play c-ip:127.0.0.1 x-sname:0e28cc30-b954-477d-9330-75042add946d x-name:avatar.flv
2011-09-30 16:40:55,812 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:play c-ip:127.0.0.1 x-sname:a434d3ac-b46f-44bb-ba38-2e43f705909e
2011-09-30 16:40:55,815 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:play c-ip:127.0.0.1 x-sname:a434d3ac-b46f-44bb-ba38-2e43f705909e x-name:avatar.flv
2011-09-30 16:40:55,820 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:play c-ip:127.0.0.1 x-sname:ee442403-0772-491b-895e-4fc463a1a4b2
...
2011-09-30 16:40:55,828 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:stop c-ip:127.0.0.1 cs-bytes:3938 sc-bytes:3387 x-sname:0e28cc30-b954-477d-9330-75042add946d x-file-length:0 x-file-size:6457675 x-name:avatar.flv
2011-09-30 16:40:55,829 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:stop c-ip:127.0.0.1 cs-bytes:3938 sc-bytes:3387 x-sname:a434d3ac-b46f-44bb-ba38-2e43f705909e x-file-length:0 x-file-size:6457675 x-name:avatar.flv
2011-09-30 16:40:55,830 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:stop c-ip:127.0.0.1 cs-bytes:3938 sc-bytes:3387 x-sname:0e28cc30-b954-477d-9330-75042add946d
2011-09-30 16:40:55,831 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:stop c-ip:127.0.0.1 cs-bytes:3938 sc-bytes:3387 x-sname:a434d3ac-b46f-44bb-ba38-2e43f705909e
2011-09-30 16:40:55,844 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:stop c-ip:127.0.0.1 cs-bytes:4005 sc-bytes:17141 x-sname:ee442403-0772-491b-895e-4fc463a1a4b2 x-file-length:0 x-file-size:6457675 x-name:avatar.flv
...
2011-09-30 16:41:21,526 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:stop c-ip:127.0.0.1 cs-bytes:4500 sc-bytes:236608 x-sname:2548e914-2c6f-498c-8011-50570a3d01d5
2011-09-30 16:41:21,527 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.Application - disconnect: RTMPMinaConnection from 127.0.0.1 : 41566 to localhost (in: 4500 out 236615 ) << [WebScope@e05ad6 Depth = 1, Path = '/default', Name = 'oflaDemo']
2011-09-30 16:41:21,528 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:session x-event:disconnect c-ip:127.0.0.1 c-client-id:26
2011-09-30 16:41:21,528 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - oflaDemo appDisconnect
2011-09-30 16:41:21,528 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.Application - appDisconnect: RTMPMinaConnection from 127.0.0.1 : 41566 to localhost (in: 4500 out 236615 )
2011-09-30 16:41:21,528 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.Application - leave: Client: 26 << [WebScope@e05ad6 Depth = 1, Path = '/default', Name = 'oflaDemo']
2011-09-30 16:41:21,528 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.Application - appLeave: Client: 26 << [WebScope@e05ad6 Depth = 1, Path = '/default', Name = 'oflaDemo']
}}}
=== servlet ===
* /red5-examples/oflaDemo/src/org/red5/demos/oflaDemo
 * Application.java: this is the main class
{{{#!vim
public class Application extends ApplicationAdapter {
    private IScope appScope;
    private IServerStream serverStream;
    public boolean appStart(IScope app) {
        super.appStart(app);
        appScope = app;
        return true;
    }
    public boolean appConnect(IConnection conn, Object[] params) {
        return super.appConnect(conn, params);
    }
    public void appDisconnect(IConnection conn) {
        if (appScope == conn.getScope() && serverStream != null) {
            serverStream.close();
        }
        super.appDisconnect(conn);
    }
}
}}}
 * DemoService.java 
 * DemoServiceImpl.java  
 * IDemoService.java
 * SecurityTest.java
=== XML files ===
* /var/lib/red5/webapps/oflaDemo/WEB-INF
{{{:
root@enk:/var/lib/red5/webapps/oflaDemo/WEB-INF# ls -R
.:
classes  lib  red5-web.properties  red5-web.xml  web.xml
./classes:
applications  logback-oflaDemo.xml  org
./classes/applications:
demoservice.js	demoservice.rb	main.js  main.rb
demoservice.py	main.groovy	main.py
./classes/org:
red5
./classes/org/red5:
demos
./classes/org/red5/demos:
oflaDemo
./classes/org/red5/demos/oflaDemo:
Application.class  DemoServiceImpl.class  SecurityTest.class
DemoService.class  IDemoService.class
./lib:
}}}
* red5-web.properties
 * included by red5-web.xml
 * webapp.contextPath will be the path to our application at connection
  * ( not the folder name under webapps!!! )
{{{#!vim
webapp.contextPath=/oflaDemo
webapp.virtualHosts=*, localhost, localhost:8088, 127.0.0.1:8088
}}}
* red5-web.xml
{{{#!vim
}}}
* web.xml
{{{#!vim
        ^M
                webAppRootKey^M
                /oflaDemo^M
        ^M
}}}
=== demo log ===
* http://localhost:5080/demos/ofla_demo.html
 * connect
 * select avatar.flv
 * playing
 * disconnect
* 0.0.0.0_access.2011-09-30.log
{{{#!vim
127.0.0.1 - - [30/Sep/2011:16:49:12 +0900] "GET /demos/ofla_demo.html HTTP/1.1" 200 861
127.0.0.1 - - [30/Sep/2011:16:49:12 +0900] "GET /demos/assets/swfobject.js HTTP/1.1" 304 -
127.0.0.1 - - [30/Sep/2011:16:49:12 +0900] "GET /demos/ofla_demo.swf HTTP/1.1" 200 130194
}}}
* red5.log
{{{#!vim
2011-09-30 16:50:20,702 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:session x-event:connect c-ip:127.0.0.1 c-client-id:27
2011-09-30 16:50:20,702 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - oflaDemo appConnect
2011-09-30 16:50:20,702 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.Application - appConnect: RTMPMinaConnection from 127.0.0.1 : 52563 to localhost (in: 3394 out 3073 )
2011-09-30 16:50:20,702 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.Application - appJoin: Client: 27 >> [WebScope@e05ad6 Depth = 1, Path = '/default', Name = 'oflaDemo']
2011-09-30 16:50:20,702 [NioProcessor-1] INFO  org.red5.server.jmx.JMXFactory - Object name: org.red5.server:type=RTMPMinaConnection,connectionType=persistent,host=localhost,port=1935,clientId=27
2011-09-30 16:50:27,320 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:play c-ip:127.0.0.1 x-sname:1204e0d5-5cd4-40b1-ae9b-7e26f4bbd2f2
2011-09-30 16:50:27,322 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:play c-ip:127.0.0.1 x-sname:1204e0d5-5cd4-40b1-ae9b-7e26f4bbd2f2 x-name:avatar.flv
2011-09-30 16:50:40,239 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:stream x-event:stop c-ip:127.0.0.1 cs-bytes:3700 sc-bytes:466225 x-sname:1204e0d5-5cd4-40b1-ae9b-7e26f4bbd2f2
2011-09-30 16:50:40,239 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.Application - disconnect: RTMPMinaConnection from 127.0.0.1 : 52563 to localhost (in: 3700 out 466225 ) << [WebScope@e05ad6 Depth = 1, Path = '/default', Name = 'oflaDemo']
2011-09-30 16:50:40,240 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - W3C x-category:session x-event:disconnect c-ip:127.0.0.1 c-client-id:27
2011-09-30 16:50:40,240 [NioProcessor-1] INFO  org.red5.demos.oflaDemo.Application - oflaDemo appDisconnect
2011-09-30 16:50:40,240 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.Application - appDisconnect: RTMPMinaConnection from 127.0.0.1 : 52563 to localhost (in: 3700 out 466225 )
2011-09-30 16:50:40,240 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.Application - leave: Client: 27 << [WebScope@e05ad6 Depth = 1, Path = '/default', Name = 'oflaDemo']
2011-09-30 16:50:40,240 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.Application - appLeave: Client: 27 << [WebScope@e05ad6 Depth = 1, Path = '/default', Name = 'oflaDemo']
}}}
* oflademo.log
{{{#!vim
2011-09-30 16:50:20,714 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - getting the FLV files
2011-09-30 16:50:20,715 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - flvName: avatar.flv
2011-09-30 16:50:20,715 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - lastModified date: 30/09/11 12:53:29
2011-09-30 16:50:20,715 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - flvBytes: 6457675
2011-09-30 16:50:20,715 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - -------
2011-09-30 16:50:20,716 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - flvName: toystory3.flv
2011-09-30 16:50:20,716 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - lastModified date: 30/09/11 12:53:29
2011-09-30 16:50:20,716 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - flvBytes: 1665121
2011-09-30 16:50:20,716 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - flvBytes: 1665121
2011-09-30 16:50:20,716 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - -------
2011-09-30 16:50:20,716 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - flvName: toystory3-vp6.flv
2011-09-30 16:50:20,716 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - lastModified date: 30/09/11 12:53:29
2011-09-30 16:50:20,716 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - flvBytes: 3755607
2011-09-30 16:50:20,716 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - -------
2011-09-30 16:50:20,717 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - flvName: avatar-vp6.flv
2011-09-30 16:50:20,717 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - lastModified date: 30/09/11 12:53:28
2011-09-30 16:50:20,717 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - flvBytes: 8130415
2011-09-30 16:50:20,717 [NioProcessor-1] DEBUG org.red5.demos.oflaDemo.DemoService - -------
}}}