SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
Concept of Streaming
      Video
Streaming Video
●   เป็ นการเล่นวิดโอแบบต่อเนื่ อง
                   ี
●   ไม่จำาเป็ นต้องโหลดมาที่เครื่องก่อนเล่น
●   เลื่อนไปเล่นตำาแหน่ งไหนก็ได้ทันที
การติดตั้ง RED5
การติดตั้ง RED5
●   สิ่งจำาเป็ น
    ●   JDK 6.0
    ●   RED5 binary ที่รวม Tomcat มาแล้ว
    ●   เครื่องมือในการพัฒนาเช่น Eclipse
    ●   เครื่องมือในการพัฒนา Flash
โครงสร้างคร่าวๆของ
      RED5
โครงสร้างของ RED5
●   An Open Source Flash Media Server
    ●   Built on Java (Mina & Spring)
    ●   Use RTMP (Real Time Messaging Protocol)
●   Streaming Audio/Video (FLV and MP3)
●   Recording Client Streams (FLV only)
●   Shared Objects
●   Live Stream Publishing
●   Remoting (AMF)
●   Multi-User Environments
ตัวอย่าง Demo
  Application
การสร้าง Application
    บน RED5
โครงสร้าง Directory
●   Webapps
    ●   Application Name
        –   WEB-INF (contains configuration files & classes)
        –   src
        –   lib
        –   classes
            web.xml
            red5-web.xml
            red5-web.properties
โครงสร้าง Directory
●   WEB-INF
    ●   src (contains all .java, .js, .py, .rb file used to build
        your app.)
    ●   lib (contains all jar files required)
    ●   classes (contains the compiled class files from the
        src directory)
        web.xml (this is the main configuration file for your
        app)
สร้างส่วน Streaming
       Server
สร้างโครงสร้าง Application
●   สร้างโครงสร้าง application ตามรูปแบบ
    directory
●   สร้าง directory streams เพื่อเก็บไฟล์ video ต่างๆ
    ที่เราจะใช้ streaming
●   คอนฟิ คค่า application
สร้างส่วน Client
FlowPlayer
●   FlowPlayer เป็ น video player ที่ทำาตัวเป็ น client
    ซึ่งทำาหน้าที่เล่นไฟล์ video แบบต่างๆบนเว็บให้
    เรา
●   เล่นได้ท้งแบบ ธรรมดา และ streaming ผ่าน
             ั
    โปรโตคอล rtmp
สร้าง FlowPlayer ให้เล่น video จาก
         streaming server
●   โหลด flowplayer
●   โหลด flowplayer rtmp flugin
●   สร้าง tag a เพื่อให้เป็ นตำาแหน่ งสำาหรับ player มา
    แทรกไว้
โค้ด script สำาหรับ FlowPlayer
<a class="player" id="fms">
     <img src="http://static.flowplayer.org/img/player/btn/showme.png" />
</a>

<script>
$f("fms", "../flowplayer-3.2.2.swf", {
      clip: {
             url: 'avatar-vp6',
             provider: 'streamingserver'
      },
      plugins: {
             streamingserver: {
                    url: 'flowplayer.rtmp-3.2.1.swf',
                    netConnectionUrl: 'rtmp://192.168.1.34/myserver'
             }
      }
});
 </script>
โค้ดเล่นไฟล์ mp3
<a class="player" id="fms">
     <img src="http://static.flowplayer.org/img/player/btn/showme.png" />
</a>

<script>
$f("fms", "../flowplayer-3.2.2.swf", {
      clip: {
             url: 'mp3:audio.mp3',
             provider: 'streamingserver'
      },
      plugins: {
             streamingserver: {
                   url: 'flowplayer.rtmp-3.2.1.swf',
                   netConnectionUrl: 'rtmp://192.168.1.34/myserver'
             }
      }
});
 </script>
โค้ดเล่นไฟล์ mp4
<a class="player" id="fms">
     <img src="http://static.flowplayer.org/img/player/btn/showme.png" />
</a>

<script>
$f("fms", "../flowplayer-3.2.2.swf", {
      clip: {
             url: 'mp4:audio.mp4',
             provider: 'streamingserver'
      },
      plugins: {
             streamingserver: {
                   url: 'flowplayer.rtmp-3.2.1.swf',
                   netConnectionUrl: 'rtmp://192.168.1.34/myserver'
             }
      }
});
 </script>
เล่นหลายๆ stream
<a class="player" id="fms">
     <img src="http://static.flowplayer.org/img/player/btn/showme.png" />
</a>

<script>
$f("fms", "../flowplayer-3.2.2.swf", {
      clip: {
             streams: [
                 { url: 'metacafe', duration: 10 },
                 { url: 'honda_accord', start: 2, duration: 10 },
                 { url: 'metacafe', start: 10, duration: 10 },
                 { url: 'honda_accord', start: 10, duration: 10 },
                 { url: 'metacafe', start: 20, duration: 10 },
                 { url: 'honda_accord', start: 20, duration: 10 },
                 { url: 'metacafe', start: 30, duration: 10 },
                 { url: 'honda_accord', start: 30, duration: 10 }
           ],
             provider: 'streamingserver'
      },
// plugins config ................................................................
 </script>

Weitere ähnliche Inhalte

Ähnlich wie Red5 workshop

01 ความรู้เกี่ยวกับการ web programming
01 ความรู้เกี่ยวกับการ web programming01 ความรู้เกี่ยวกับการ web programming
01 ความรู้เกี่ยวกับการ web programming
supatra178
 
นุ๊ก
นุ๊กนุ๊ก
นุ๊ก
sirinet
 
รออกแบบเว็บไซต์
รออกแบบเว็บไซต์รออกแบบเว็บไซต์
รออกแบบเว็บไซต์
sirinet
 
หมวย
หมวยหมวย
หมวย
sirinet
 
ดรีม
ดรีมดรีม
ดรีม
sirinet
 
หมวย
หมวยหมวย
หมวย
sirinet
 
หวิว
หวิวหวิว
หวิว
ViewMik
 

Ähnlich wie Red5 workshop (20)

Joomla CMS
Joomla CMSJoomla CMS
Joomla CMS
 
Hotspotubuntu8
Hotspotubuntu8Hotspotubuntu8
Hotspotubuntu8
 
Docker 1st time
Docker 1st timeDocker 1st time
Docker 1st time
 
Slide 9 april_2011_pdf
Slide 9 april_2011_pdfSlide 9 april_2011_pdf
Slide 9 april_2011_pdf
 
ICT with Web site
ICT with Web siteICT with Web site
ICT with Web site
 
Ch12 web-app-part2
Ch12 web-app-part2Ch12 web-app-part2
Ch12 web-app-part2
 
การพัฒนาเอกสารออนไลน์ขั้นสูง Lect 05
การพัฒนาเอกสารออนไลน์ขั้นสูง Lect 05การพัฒนาเอกสารออนไลน์ขั้นสูง Lect 05
การพัฒนาเอกสารออนไลน์ขั้นสูง Lect 05
 
Cent os
Cent osCent os
Cent os
 
01 ความรู้เกี่ยวกับการ web programming
01 ความรู้เกี่ยวกับการ web programming01 ความรู้เกี่ยวกับการ web programming
01 ความรู้เกี่ยวกับการ web programming
 
Building ec
Building ecBuilding ec
Building ec
 
Greenstone Installation
Greenstone InstallationGreenstone Installation
Greenstone Installation
 
คุณสมบัติของข้อมูลกิจกรรมและองค์ประกอบอื่นๆ ที่เกี่ยวข้องกับความมั่นคงปลอดภัย...
คุณสมบัติของข้อมูลกิจกรรมและองค์ประกอบอื่นๆ ที่เกี่ยวข้องกับความมั่นคงปลอดภัย...คุณสมบัติของข้อมูลกิจกรรมและองค์ประกอบอื่นๆ ที่เกี่ยวข้องกับความมั่นคงปลอดภัย...
คุณสมบัติของข้อมูลกิจกรรมและองค์ประกอบอื่นๆ ที่เกี่ยวข้องกับความมั่นคงปลอดภัย...
 
นุ๊ก
นุ๊กนุ๊ก
นุ๊ก
 
รออกแบบเว็บไซต์
รออกแบบเว็บไซต์รออกแบบเว็บไซต์
รออกแบบเว็บไซต์
 
โบ
โบโบ
โบ
 
Best
BestBest
Best
 
หมวย
หมวยหมวย
หมวย
 
ดรีม
ดรีมดรีม
ดรีม
 
หมวย
หมวยหมวย
หมวย
 
หวิว
หวิวหวิว
หวิว
 

Red5 workshop

  • 1.
  • 3. Streaming Video ● เป็ นการเล่นวิดโอแบบต่อเนื่ อง ี ● ไม่จำาเป็ นต้องโหลดมาที่เครื่องก่อนเล่น ● เลื่อนไปเล่นตำาแหน่ งไหนก็ได้ทันที
  • 5. การติดตั้ง RED5 ● สิ่งจำาเป็ น ● JDK 6.0 ● RED5 binary ที่รวม Tomcat มาแล้ว ● เครื่องมือในการพัฒนาเช่น Eclipse ● เครื่องมือในการพัฒนา Flash
  • 7. โครงสร้างของ RED5 ● An Open Source Flash Media Server ● Built on Java (Mina & Spring) ● Use RTMP (Real Time Messaging Protocol) ● Streaming Audio/Video (FLV and MP3) ● Recording Client Streams (FLV only) ● Shared Objects ● Live Stream Publishing ● Remoting (AMF) ● Multi-User Environments
  • 10. โครงสร้าง Directory ● Webapps ● Application Name – WEB-INF (contains configuration files & classes) – src – lib – classes web.xml red5-web.xml red5-web.properties
  • 11. โครงสร้าง Directory ● WEB-INF ● src (contains all .java, .js, .py, .rb file used to build your app.) ● lib (contains all jar files required) ● classes (contains the compiled class files from the src directory) web.xml (this is the main configuration file for your app)
  • 13. สร้างโครงสร้าง Application ● สร้างโครงสร้าง application ตามรูปแบบ directory ● สร้าง directory streams เพื่อเก็บไฟล์ video ต่างๆ ที่เราจะใช้ streaming ● คอนฟิ คค่า application
  • 15. FlowPlayer ● FlowPlayer เป็ น video player ที่ทำาตัวเป็ น client ซึ่งทำาหน้าที่เล่นไฟล์ video แบบต่างๆบนเว็บให้ เรา ● เล่นได้ท้งแบบ ธรรมดา และ streaming ผ่าน ั โปรโตคอล rtmp
  • 16. สร้าง FlowPlayer ให้เล่น video จาก streaming server ● โหลด flowplayer ● โหลด flowplayer rtmp flugin ● สร้าง tag a เพื่อให้เป็ นตำาแหน่ งสำาหรับ player มา แทรกไว้
  • 17. โค้ด script สำาหรับ FlowPlayer <a class="player" id="fms"> <img src="http://static.flowplayer.org/img/player/btn/showme.png" /> </a> <script> $f("fms", "../flowplayer-3.2.2.swf", { clip: { url: 'avatar-vp6', provider: 'streamingserver' }, plugins: { streamingserver: { url: 'flowplayer.rtmp-3.2.1.swf', netConnectionUrl: 'rtmp://192.168.1.34/myserver' } } }); </script>
  • 18. โค้ดเล่นไฟล์ mp3 <a class="player" id="fms"> <img src="http://static.flowplayer.org/img/player/btn/showme.png" /> </a> <script> $f("fms", "../flowplayer-3.2.2.swf", { clip: { url: 'mp3:audio.mp3', provider: 'streamingserver' }, plugins: { streamingserver: { url: 'flowplayer.rtmp-3.2.1.swf', netConnectionUrl: 'rtmp://192.168.1.34/myserver' } } }); </script>
  • 19. โค้ดเล่นไฟล์ mp4 <a class="player" id="fms"> <img src="http://static.flowplayer.org/img/player/btn/showme.png" /> </a> <script> $f("fms", "../flowplayer-3.2.2.swf", { clip: { url: 'mp4:audio.mp4', provider: 'streamingserver' }, plugins: { streamingserver: { url: 'flowplayer.rtmp-3.2.1.swf', netConnectionUrl: 'rtmp://192.168.1.34/myserver' } } }); </script>
  • 20. เล่นหลายๆ stream <a class="player" id="fms"> <img src="http://static.flowplayer.org/img/player/btn/showme.png" /> </a> <script> $f("fms", "../flowplayer-3.2.2.swf", { clip: { streams: [ { url: 'metacafe', duration: 10 }, { url: 'honda_accord', start: 2, duration: 10 }, { url: 'metacafe', start: 10, duration: 10 }, { url: 'honda_accord', start: 10, duration: 10 }, { url: 'metacafe', start: 20, duration: 10 }, { url: 'honda_accord', start: 20, duration: 10 }, { url: 'metacafe', start: 30, duration: 10 }, { url: 'honda_accord', start: 30, duration: 10 } ], provider: 'streamingserver' }, // plugins config ................................................................ </script>