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

所属分类: 网络编程 / 网页播放器 阅读数: 1175
收藏 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)
更多精彩内容其他人还在看

javascript控制realplayer对象使用

javascript控制realplayer对象使用
收藏 0 赞 0 分享

内嵌式RealPlayer播放器的参数含义

内嵌式RealPlayer播放器的参数含义
收藏 0 赞 0 分享

功能齐全的Real播放器

功能齐全的Real播放器
收藏 0 赞 0 分享

多首歌曲连续播放之asx播放列表文件

多首歌曲连续播放之asx播放列表文件
收藏 0 赞 0 分享

图片自动播放器脚本之家修正

图片自动播放器脚本之家修正
收藏 0 赞 0 分享

封装的一个播放器wmv

封装的一个播放器wmv
收藏 0 赞 0 分享

利用JAVASCRIPT控制MEDIA PLAYER的功能实现

利用JAVASCRIPT控制MEDIA PLAYER的功能实现
收藏 0 赞 0 分享

来自CSDN的"无限流"分页程序

来自CSDN的"无限流"分页程序
收藏 0 赞 0 分享

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

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

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

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