当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 在网页中使用realplayer播放rm文件

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 在网页中使用realplayer播放rm文件


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-10   浏览: 433 ::
收藏到网摘: n/a

第1回
1.1 Intorduces
 embeded RealPlayer使realPlayer嵌入在ie或netscape中来播放rm流,通过netscape plug-in 或ActiveX你能访问插件的属性方法,控制
 影片的播放,与用户进行交互,他们通常通过java,javascript,vbscript,c++,...等来访问
 
 1.2 embeded presentations
 嵌入样式包括视频窗口,音量控制,以及一些控制按钮等。
 1.2.1 Using <EMBED> Tags for the Netscape Plug-in
 
 在Netscape中使用<EMBED>有三个必需的参数(SRC,WIDTH,HEIGHT),还有其他的一些参数,但是可选的。
 例如:<EMBED SRC="MY_LIFE.RPM" WIDTH=300 HEIGHT=134 >
 Tip:SRC是可以省略的,当mime Type 参数如下时:
 <EMBED ...,TYPE="audio/x-pn-realaudio-plugin",...>,这样做会产生不可预料的结果,因此强烈推荐你包含SRC属性,
 并且提供一个空的文件的文件名。
 
 1.2.2 Using <OBJECT> Tags for the ActiveX Control
 在IE中使用RealPlayer的Activex控件必需包含下列的classID:
 CLASSID="clsid:CFCDAA03-8BE4-11cf-B848-0020AFBBCCFA"
 并且指定播放区域的宽度和高度。如果你想对该Activex控件进行编程请指定ID属性,例如ID=RM1.
 例子:<OBJECT ID=RM1 CLASSID="clsid:CFCDAA03-8BE4-11cf-B848-0020AFBBCCFA" WIDTH=300 HEIGHT=134>
          ...parameters...
       </OBJECT>
 1.3.1Using RealPayer Methods through JavaScript
 
 <EMBED NAME=javademo SRC="走遍美国.rm" WIDTH=220 HEIGHT=180 CONSOLE=ONE CONTROLS=ImageWindow BACKGROUNDCOLOR=white
 CENTER=TRUE>
 你可以通过一下代码来控制它:
 <input type=button value=play onclick="document.javademo.DoPlay()">
  <input type=button value=pause onclick="document.javademo.DoPause()">
   <input type=button value=stop onclick="document.javademo.DoStop()">
 1.3.2 Using RealPlayer Methods through VBScript
 <OBJECT ID=JAVADEMO CLASSID="clsid:CFCDAA03-8BE4-11cf-B848-0020AFBBCCFA" WIDTH=220 HEIGHT=180>
 <PARAM NAME="SRC" VALUE="走遍美国.rm" >
 <PARAM NAME="CONSOLE" VALUE="ONE"
 <PARAM NAME="CONTROLS" VALUE="ImageWindow">
 <PARAM NAME="BACKGROUNDCOLOR" VALUE="white">
 <PARAM NAME="CENTER" VALUE="true">
 </OBJECT>
 你可以如下控制它:
 <FORM>
 <input type="button" value="play" name="doplay">
 <script> language="VBScript" for="doplay" event="onClick">
 javademo.DoPlay
 </script>
 ........
 </FORM>
 
 
 第二回 Using Method  and parameters(介绍简单的)
 DoStop() 停止
 DoPlay()播放
 doPause()暂停
 setSource()设置文件来源
 
 console 用于指定控制是用于哪个embeded presentation
 controls 用于指定embeded presentation的控制,如image window ,playbutton,.....
 backgroundcolor 用于指定imagewindow的背景
 width
 height
 autostart 自动播放
 
 第三回 同时播放多个文件(所有文件请放于web server上)
 3.1编辑.rpm文件
 1.rpm的内容:
 http://127.0.0.1/1-1.rm
 http://127.0.0.1/1-2.rm
 3.2完整源文件
 <HTML>
<body >

<EMBED SRC="http://127.0.0.1/1.rpm" WIDTH=240 HEIGHT=180 NOJAVA=true CONTROLS=ImageWindow CONSOLE=one><br>

<OBJECT ID=RAOCX CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" HEIGHT="100" WIDTH="240">
  
   <PARAM NAME="AUTOSTART" Value="true">
   <PARAM NAME="CONTROLS" VALUE=ConrolPane>
   <param name="console" value="one">
   <PARAM NAME="SRC" VALUE="http://127.0.0.1/1.rpm">

</OBJECT>

</body>
</html>