网页视频播放器程序代码(通用代码)

所属分类: 网络编程 / 网页播放器 阅读数: 1150
收藏 0 赞 0 分享
'***********************************************
'函数名:SelPlay
'作  用:在网页中播放视频
'参  数:strUrl ---- 视频地址
           strWidth ---显示视频宽
           strHeight ---显示视频高
'***********************************************
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)
更多精彩内容其他人还在看

歌词编辑器和选择歌曲可播放的网页

歌词编辑器和选择歌曲可播放的网页
收藏 0 赞 0 分享

非常全的javascript控制MediaPlayer的属性集合

非常全的javascript控制MediaPlayer的属性集合
收藏 0 赞 0 分享

1ting的歌词同步,所用到的代码

1ting的歌词同步,所用到的代码
收藏 0 赞 0 分享

关于网页媒体播放器兼容性的问题(附原码) 下载

关于网页媒体播放器兼容性的问题(附原码) 下载
收藏 0 赞 0 分享

asp.net 页面中添加普通视频的几种方式

公司需要在一个测试网页中插入视频,今天正好有时间整理了三个普通的插入视频的方式。
收藏 0 赞 0 分享

[翻译] JW Media Player 中文文档第1/4页

[翻译] JW Media Player 中文文档
收藏 0 赞 0 分享

在线FLV播放器实现方法

者主页: http://www.jeroenwijering.com/?item=Flash_Video_Player http://www.cgfans.net/bbs/Medias/2007/10/flash_flv_player.zip这个是2.5版本 使用方法:如果你
收藏 0 赞 0 分享

flv播放器 在网页中播放flv

以前找了很久,现在的项目中用到了。需要的自己下载。 现在我们可以方便的在网页中播放flv文件了
收藏 0 赞 0 分享

宝丽通3.90播放器调用代码

宝利通网络媒体播放器是一款支持HTTP协议的流媒体播放器, 无缓冲,拖放速度快是他最大的优点.2年前曾经做的一个Project用的就是它.
收藏 0 赞 0 分享

电影系统调用“宝丽通”加速播放器,任意拖动不会卡

电影系统调用“宝丽通”加速播放器,任意拖动不会卡,绝对好东西!不信你试试!
收藏 0 赞 0 分享
查看更多