asp 实现视频显示的效果函数
程序员文章站
2023-01-25 08:05:36
<% '****************************** '函数:selplay(strurl,strwidth,strheight) '参数:strur...
<%
'******************************
'函数:selplay(strurl,strwidth,strheight)
'参数:strurl,动画视频路径;strwidth,视频高度;strheight,视频高度
'作者:阿里西西
'日期:2007/7/13
'描述:取得用户真实ip,对代理地址仍然有效;返回值:文本类型的ip地址
'示例:<%=selplay("mov.swf","120","90")%>
'******************************
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,swf"
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>"
case "swf"
response.write "<embed src="""&strurl&""" width="""&strwidth&""" height="""&strheight&""" type=""application/x-shockwave-flash"" play=""true"" loop=""true"" menu=""true""></embed>"
case else
response.write "<img src=""/images/nodv.jpg"" />"
end select
end if
end sub
%>
'******************************
'函数:selplay(strurl,strwidth,strheight)
'参数:strurl,动画视频路径;strwidth,视频高度;strheight,视频高度
'作者:阿里西西
'日期:2007/7/13
'描述:取得用户真实ip,对代理地址仍然有效;返回值:文本类型的ip地址
'示例:<%=selplay("mov.swf","120","90")%>
'******************************
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,swf"
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>"
case "swf"
response.write "<embed src="""&strurl&""" width="""&strwidth&""" height="""&strheight&""" type=""application/x-shockwave-flash"" play=""true"" loop=""true"" menu=""true""></embed>"
case else
response.write "<img src=""/images/nodv.jpg"" />"
end select
end if
end sub
%>