ASP video Playback Code

Source: Internet
Author: User

<% @LANGUAGE = "VBSCRIPT" codepage= "936"%>
<!--#include file= "conn/conn.asp tutorial";
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd"
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312"
<%dim Sql , Id
Id=html_encode (request.querystring ("id")
 if id<> "" Or isnumeric (ID) Then
  sql = "SELECT * from Vod Where id=" &id
  call opendb ()
  rs.open sql,conn,1,3
   if not rs.eof Then
  rs (8) =rs (8) +1
  rs.update
%>
<title><%=rs ( 1)%></title>
<style type= "text/css Tutorial"
<!--
Body {
 background-image:url ( Index_files/html_bg_img.gif);
 margin-left:0px;
 margin-top:10px;
 margin-right:0px;
 margin-bottom:0px;
}

</style>

<body>
<table width= "443" height= "223" border= "0" align= "center" cellpadding= "0" cellspacing= "0" >
<tr>
<TD width= "443" height= "223" align= "center" ><%call Play (Rs ("Vod_path"), 400,340)%></td>
</tr>
</table>
<% Call Closedb
Else
Response.Write ("Data loss, Server busy ...")
End If
Else
Response.Write ("Operation failed, please do not mess.")
End If

Function Play (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,wma"
If Instr (exts,isext) =0 Then
Response.Write "Illegal video files"
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=50 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 Function

%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.