· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Red5 Install/Open Laszlo

Red5Install/OpenLaszlo


* 2011.10.8
<canvas debug="true">
      <rtmpconnection src="rtmp://localhost/oflaDemo/"    
            autoconnect="true"/>
      <rtmpstatus/>
      <videoplayer url="avatar.flv" type="rtmp" autoplay="true"
            x="30" y="30" width="320" height="240" debug="true"/>
</canvas>
  • url 의 경로 점검 필요


* 2011.10.2

* openlaszlo demo videolibrary

* videolibrary.lzx
  • canvas
    • include
    <include href="av/videotogglebutton.lzx"/>
    <include href="av/videoscreen.lzx"/>
    <include href="av/videoslider.lzx"/>
    <include href="av/videoplayer.lzx"/>
    <include href="av/videothumbnail.lzx"/>
    <include href="av/videolibrarypopup.lzx"/>
    <include href="videocamerabutton.lzx"/>
    <include href="videocamerapanel.lzx"/>
    <include href="videolibrarybutton.lzx"/>
    <include href="videolibrarypanel.lzx"/>
    <include href="videolibrarythumbnail.lzx"/>
    <include href="videocontrols.lzx"/>
    <include href="videolibraryplayer.lzx"/>
  • 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

* <class name="videolibraryplayer">
  • <attribute name="type" type="string" value="rtmp"/> ...
  • <method name="makeNewVideo">
    • components/av/videoplayer.lzx
  • />
  • />
  • <videolibrarypopup name="librarypopup"/>
    • components/av/videolibrarypopup.lzx

* <class name="videocontrols">
  • <attribute name="ms" value="null"/> ...
  • />
  • />
  • />
  • />
  • />

*
  • extends="videotogglebutton"
    • components/av/videotogglebutton.lzx

* videocamerapanel.lzx
  • <class name="videocamerapanel" ...>
    • <attribute name="ms" value="null"/>
      • cam, mic, opened, topHeight, openWidth, videomaker
    • <handler name="onopened">
      • this.cam.setAttribute("show", this.opened);
      • ]]>
    • </handler>
    • <view name="bg" ..../>
    • <videotogglebutton name="recordbutton"....visible="${classroot.cam.allowed}">
      • <handler name="onengaged">
          • classroot.cam.setAttribute("show", true);
        • ]]>
      • </handler>
    • </videotogglebutton>
    • <view name="timedisplay" ...>
      • <view name="background" ... />
      • <text name="recordtimefield" .../>
    • </view>
    • <view name="audiometer" ...>
      • <view name="background" .../>
      • <view name="g" ...>
      • </view>
    • </view>
      • visible="${!classroot.cam.allowed}"
      • onclick="classroot.cam.showSettings()"/>
    • <text name="t1" ...visible="${!classroot.cam.allowed}"/>
    • <text name="t2" ...visible="${!classroot.cam.allowed}"/>
  • </class>
* 2011.9.30

* synaptic * 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

openlaszlo


<canvas debug="true">
        <rtmpconnection src="rtmp://localhost/oflaDemo" autoconnect="true">
        <handler name="onconnect">
                Debug.write("connected");
        </handler>
        <handler name="onerror">
                Debug.write("error");
        </handler>
    </rtmpconnection>
    <videoview id="v" url="avatar.flv" type="rtmp" autoplay="true"/>
  <button x="10" y="200" text="play" onclick="v.stream.play()"/>
  <button x="80" y="200" text="stop" onclick="v.stream.stop()"/>
</canvas>

* log
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
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!!! )
webapp.contextPath=/oflaDemo
webapp.virtualHosts=*, localhost, localhost:8088, 127.0.0.1:8088

* red5-web.xml
<bean id="web.handler" class="org.red5.demos.oflaDemo.Application" />
<bean id="demoService.service" class="org.red5.demos.oflaDemo.DemoService" />

* web.xml
        <context-param>^M
                <param-name>webAppRootKey</param-name>^M
                <param-value>/oflaDemo</param-value>^M
        </context-param>^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
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
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
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 - -------



sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2011-10-08 16:33:17
Processing time 0.0118 sec