欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

jsp播放视频文件的方法总结

程序员文章站 2023-11-17 21:14:58
本文实例讲述了jsp播放视频文件的方法。分享给大家供大家参考,具体如下: 1.avi格式 代码片断如下: jsp代码:

本文实例讲述了jsp播放视频文件的方法。分享给大家供大家参考,具体如下:

1.avi格式

代码片断如下:

jsp代码:

<object id="video" width="400" height="200" border="0" classid="clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa">
<param name="showdisplay" value="0">
<param name="showcontrols" value="1">
<param name="autostart" value="1">
<param name="autorewind" value="0">
<param name="playcount" value="0">
<param name="appearance value="0 value=""">
<param name="borderstyle value="0 value=""">
<param name="moviewindowheight" value="240">
<param name="moviewindowwidth" value="320">
<param name="filename" value="file:///d|/work/vod/mbar.avi">
<embed width="400" height="200" border="0" showdisplay="0" showcontrols="1" autostart="1" autorewind="0" playcount="0" moviewindowheight="240" moviewindowwidth="320" filename="file:///d|/work/vod/mbar.avi" src="mbar.avi">
</embed>
</object>

2.mpg格式

代码片断如下:

jsp代码:

<object classid="clsid:05589fa1-c356-11ce-bf01-00aa0055595a" id="activemovie1" width="239" height="250">
<param name="appearance" value="0">
<param name="autostart" value="-1">
<param name="allowchangedisplaymode" value="-1">
<param name="allowhidedisplay" value="0">
<param name="allowhidecontrols" value="-1">
<param name="autorewind" value="-1">
<param name="balance" value="0">
<param name="currentposition" value="0">
<param name="displaybackcolor" value="0">
<param name="displayforecolor" value="16777215">
<param name="displaymode" value="0">
<param name="enabled" value="-1">
<param name="enablecontextmenu" value="-1">
<param name="enablepositioncontrols" value="-1">
<param name="enableselectioncontrols" value="0">
<param name="enabletracker" value="-1">
<param name="filename" value="../../../mpeg/halali.mpg" valuetype="ref">
<param name="fullscreenmode" value="0">
<param name="moviewindowsize" value="0">
<param name="playcount" value="1">
<param name="rate" value="1">
<param name="selectionstart" value="-1">
<param name="selectionend" value="-1">
<param name="showcontrols" value="-1">
<param name="showdisplay" value="-1">
<param name="showpositioncontrols" value="0">
<param name="showtracker" value="-1">
<param name="volume" value="-480">
</object>

3.smi格式

代码片断如下:

jsp代码:

<object id=rvocx classid=clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa width=240 height=180>
<param name="_extentx" value="6350">
<param name="_extenty" value="4763">
<param name="autostart" value="-1">
<param name="shuffle" value="0">
<param name="prefetch" value="0">
<param name="nolabels" value="-1">
<param name="src" value="rm.rm">
<param name="controls" value="imagewindow">
<param name="console" value="console1">
<param name="loop" value="0">
<param name="numloop" value="0">
<param name="center" value="0">
<param name="maintainaspect" value="0">
<param name="backgroundcolor" value="#000000"><embed src="real.smi" type="audio/x-pn-realaudio-plugin" console="console1" controls="imagewindow" height="180" width="240" autostart="true"></object>

4.rm格式

代码片断如下:

java代码:

<object id=video1 classid="clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa" height=288 width=352>
<param name="_extentx" value="9313">
<param name="_extenty" value="7620">
<param name="autostart" value="0">
<param name="shuffle" value="0">
<param name="prefetch" value="0">
<param name="nolabels" value="0">
<param name="src" value="rtsp://203.207.131.35/vod/dawan-a.rm";;;>
<param name="controls" value="imagewindow">
<param name="console" value="clip1">
<param name="loop" value="0">
<param name="numloop" value="0">
<param name="center" value="0">
<param name="maintainaspect" value="0">
<param name="backgroundcolor" value="#000000"><embed src type="audio/x-pn-realaudio-plugin" console="clip1" controls="imagewindow" height="288" width="352" autostart="false">
</object>

5.wmv格式

代码片断如下:

<object id="nsplay" width=200 height=180 classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=6,4,5,715" standby="loading microsoft windows media player components..." type="application/x-oleobject" align="right" hspace="5">
<!-- asx file name -->
<param name="autorewind" value=1>
<param name="filename" value="******.wmv">
<!-- display controls -->
<param name="showcontrols" value="1">
<!-- display position controls -->
<param name="showpositioncontrols" value="0">
<!-- display audio controls -->
<param name="showaudiocontrols" value="1">
<!-- display tracker controls -->
<param name="showtracker" value="0">
<!-- show display -->
<param name="showdisplay" value="0">
<!-- display status bar -->
<param name="showstatusbar" value="0">
<!-- diplay go to bar -->
<param name="showgotobar" value="0">
<!-- display controls -->
<param name="showcaptioning" value="0">
<!-- player autostart -->
<param name="autostart" value=1>
<!-- animation at start -->
<param name="volume" value="-2500">
<param name="animationatstart" value="0">
<!-- transparent at start -->
<param name="transparentatstart" value="0">
<!-- do not allow a change in display size -->
<param name="allowchangedisplaysize" value="0">
<!-- do not allow scanning -->
<param name="allowscan" value="0">
<!-- do not show contect menu on right mouse click -->
<param name="enablecontextmenu" value="0">
<!-- do not allow playback toggling on mouse click -->
<param name="clicktoplay" value="0">
</object>

6.wma格式

放在 <body> 里面。下面是部分解释:

<object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="mediaplayer1" >
<param name="filename" value="1.wma"> <!--你文件的位置-->
<param name="playcount" value="1"><!--控制重复次数: “x”为几重复播放几次; x=0,无限循环。-->
<param name="autostart" value="0"><!--控制播放方式: x=1,打开网页自动播放; x=0,按播放键播放。-->
<param name="clicktoplay" value="1"><!--控制播放开关: x=1,可鼠标点击控制播放或暂停状态; x=0,禁用此功能。-->
<param name="displaysize" value="0"><!--控制播放画面: x=0,原始大小; x=1,一半大小; x=2,2倍大小。-->
<param name="enablefullscreen controls" value="1"><!--控制切换全屏: x=1,允许切换为全屏; x=0,禁用此功能。-->
<param name="showaudio controls" value="1"><!--控制音量: x=1,允许调节音量; x=0,禁止音量调节。-->
<param name="enablecontext menu" value="1"><!--控制快捷菜单: x=1,允许使用右键菜单; x=0,禁用右键菜单。-->
<param name="showdisplay" value="1"><!--控制版权信息: x=1,显示电影及作者信息;x=0,不显示相关信息-->
</object >

希望本文所述对大家jsp程序设计有所帮助。