asp 网页视频播放器程序代码(通用代码),支持avi,wmv,asf,mov,rm,ra,ram等
2018-10-12 14:00
525 查看
思路是先取得文件的类型,并根据类型选择不同的网页播放器代码..三下五去二.....同时为了代码在以后的复用性,写成了通用的调用函数.方便以后在别的系统中调用..
现发布源代码如下:
调用方式:
其实更好的代码,在一些比较不错的在线播放器源码等,可以参考下,如:马克斯等视频播放系统。
现发布源代码如下:
Sub SelPlay(strUrl,strWidth,StrHeight)
Dim Exts,isExt
If strUrl <> "" Then
isExt = LCase(Mid(strUrl,InStrRev(strUrl, ".")+1))
Else
isExt = ""
End If
Exts = "avi,wmv,asf,mov,rm,ra,ram"
If Instr(Exts,isExt)=0 Then
Response.write "非法视频文件"
Else
Select Case isExt
Case "avi","wmv","asf","mov"
Response.write "<EMBED id=MediaPlayer src="&strUrl&" width="&strWidth&" height="&strHeight&" loop=""false"" autostart=""true""></EMBED>"
Case "mov","rm","ra","ram"
Response.Write "<OBJECT height="&strHeight&" width="&strWidth&" classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA>"
Response.Write "<PARAM NAME=""_ExtentX"" VALUE=""12700"">"
Response.Write "<PARAM NAME=""_ExtentY"" VALUE=""9525"">"
Response.Write "<PARAM NAME=""AUTOSTART"" VALUE=""-1"">"
Response.Write "<PARAM NAME=""SHUFFLE"" VALUE=""0"">"
Response.Write "<PARAM NAME=""PREFETCH"" VALUE=""0"">"
Response.Write "<PARAM NAME=""NOLABELS"" VALUE=""0"">"
Response.Write "<PARAM NAME=""SRC"" VALUE="""&strUrl&""">"
Response.Write "<PARAM NAME=""CONTROLS"" VALUE=""ImageWindow"">"
Response.Write "<PARAM NAME=""CONSOLE"" VALUE=""Clip"">"
Response.Write "<PARAM NAME=""LOOP"" VALUE=""0"">"
Response.Write "<PARAM NAME=""NUMLOOP"" VALUE=""0"">"
Response.Write "<PARAM NAME=""CENTER"" VALUE=""0"">"
Response.Write "<PARAM NAME=""MAINTAINASPECT"" VALUE=""0"">"
Response.Write "<PARAM NAME=""BACKGROUNDCOLOR"" VALUE=""#000000"">"
Response.Write "</OBJECT>"
Response.Write "<BR>"
Response.Write "<OBJECT height=32 width="&strWidth&" classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA>"
Response.Write "<PARAM NAME=""_ExtentX"" VALUE=""12700"">"
Response.Write "<PARAM NAME=""_ExtentY"" VALUE=""847"">"
Response.Write "<PARAM NAME=""AUTOSTART"" VALUE=""0"">"
Response.Write "<PARAM NAME=""SHUFFLE"" VALUE=""0"">"
Response.Write "<PARAM NAME=""PREFETCH"" VALUE=""0"">"
Response.Write "<PARAM NAME=""NOLABELS"" VALUE=""0"">"
Response.Write "<PARAM NAME=""CONTROLS"" VALUE=""ControlPanel,StatusBar"">"
Response.Write "<PARAM NAME=""CONSOLE"" VALUE=""Clip"">"
Response.Write "<PARAM NAME=""LOOP"" VALUE=""0"">"
Response.Write "<PARAM NAME=""NUMLOOP"" VALUE=""0"">"
Response.Write "<PARAM NAME=""CENTER"" VALUE=""0"">"
Response.Write "<PARAM NAME=""MAINTAINASPECT"" VALUE=""0"">"
Response.Write "<PARAM NAME=""BACKGROUNDCOLOR"" VALUE=""#000000"">"
Response.Write "</OBJECT>"
End Select
End If
End Sub
调用方式:
Call SelPlay(DvUrl,280,220)
其实更好的代码,在一些比较不错的在线播放器源码等,可以参考下,如:马克斯等视频播放系统。
您可能感兴趣的文章:
- 超级REAL视频播放器
- 网页视频播放器程序代码(通用代码)
- flvplayer.swf flv视频播放器使用方法
- vbs sendKeys 16进制的结合使用(打开IE,静音,打开播放器等)
- (jsp/html)网页上嵌入播放器(常用播放器代码整理)
- JS HTML5 音乐天气播放器(Ajax获取天气信息)
- android暂停或停止其他音乐播放器的播放实现代码
- android webvie指定视频播放器播放网站视频
- asp.net实现在线音乐播放器示例
- PHP实现使用优酷土豆视频地址获取swf播放器分享地址
- Flex播放器(实现播放、缓冲进度条和音频曲线显示)
- 基于C#的音乐播放器主Form实现代码
- javascript实现简单的html5视频播放器
- 基于Flowplayer打造一款免费的WEB视频播放器附源码
相关文章推荐
- c#版本视频在线播放(通用播放器调用),支持avi,wmv,asf,mov,rm,ra,ram等
- iOS支持MP4,AVI,NAVI,DV-AVI,DIVX,MOV,ASF,WMV,RM,RMVB等视频格式。
- 截取视频文件第一桢的图片和转换视频格式文件为flv(支持文件格式:asf,avi,mpg,flv,3gp,mov,wmv)
- 支持wmv、mpg、mov、avi格式的网页视频播放代码
- 截取视频文件第一桢的图片和转换视频格式文件为flv(支持文件格式:asf,avi,mpg,flv,3gp,mov,wmv)
- [转]截取视频文件第一桢的图片和转换视频格式文件为flv(支持文件格式:asf,avi,mpg,flv,3gp,mov,wmv)
- 支持wmv、mpg、mov、avi格式的网页视频播放代码
- [转]截取视频文件第一桢的图片和转换视频格式文件为flv(支持文件格式:asf,avi,mpg,flv,3gp,mov,wmv)
- 网页视频播放器程序代码(通用代码)
- 支持wmv、mpg、mov、avi格式的网页视频播放代码
- 支持mp4、wmv、mpg、mov、avi格式的网页视频播放代码
- 如何在 ASP.net网页中播放视频 ----支持rmvb,rm,avi,flv,swf,3gp
- 支持wmv、mpg、mov、avi格式的网页视频播放代码
- ASP程序实现网页伪静态页源代码
- 在线播放器代码大全(avi/mpg/rm/wmv/)
- 掌握 dump filter 的用法:采集MPG,AVI和ASF的程序代码
- [ASP代码]网页签名小程序
- 51CTO学院视频技术要求(格式新增mov,avi,rm,rmvb,flv,wmv)
- swf、wmv、mov、RM几种常见格式视频播放器代码!
- ASP程序实现网页伪静态页源代码