《Red5 用户参考手册》之十二:Red5 核心技术第五章 脚本实现
官方最新《Red5 用户参考手册》全套下载地址
I. 选择一个脚本实现
级别:初级
RED5 含有以下脚本语言的解释器:
* Javascript - version 1.6 (Mozilla Rhino version 1.6 R7)
* JRuby - version 1.0.1 (Ruby version 1.8.5)
* Jython - version 2.2 (Python version 2.1)
* Groovy - version 1.0
* Beanshell - version 2.0b4
RED5 的以后版本可能会含有以下脚本语言的解释器:
* JudoScript
* Scala
* PHP(这个不一般,我们可能会只是提供一个桥梁)
* Actionscript (可能会是 SSAS)
脚本实现类根据你的 Java 版本预先指定在以下位置:
[Bindable] public var videoList:ArrayCollection; public function catchVideos():void{ // call server-side method // create a responder and set it to getMediaList var nc_responder:Responder = new Responder(getMediaList, null); // call the server side method to get list of FLV's nc.call("demoService.getListOfAvailableFLVs", nc_responder); } public function getMediaList(list:Object):void{ // this is the result of the server side getListOfAvailableFLVs var mediaList:Array = new Array(); for(var items:String in list){ mediaList.push({label:items, size:list[items].size, dateModified:list[items].lastModifi } // videoList is bindable and the datagrid is set to use this for it's dataprovider // wrap it in an ArrayCollection first videoList = new ArrayCollection(mediaList); }