登陆 免费注册 提交网站
站长资讯 >> 站长学院 >> 网络编程
 2007-08-17 10:13浏览: 2797 次

ASP根据视频格式正确的播放的函数

 在给客户做个程序时,突然遇到个问题,就是产品页用户提交视频播放文件时,如何根据提交的网址内的视频格式进行正确的播放呢....郁闷了一会,想好了思路,说动手就动手...

  思路是先取得文件的类型,并根据类型选择不同的网页播放器代码..三下五去二.....同时为了代码在以后的复用性,写成了通用的调用函数.方便以后在别的系统中调用..

  现发布源代码如下:

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 ""

Case "mov","rm","ra","ram"

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write "

"

Response.Write "
"

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write ""

Response.Write "

"

End Select

End If

End Sub

调用方式:

Call SelPlay(DvUrl,280,220)

网站首页 - 关于我们 - 联系我们 - 友情链接 - 帮助中心
Copyright ©2007-2022 www.Aisila.com All Rights Reserved
苏ICP备20008864号-4