怎么在asp网页上加一个在线视频播放功能!已经有了播放器源码

在asp网页上加一个在线视频播放功能!已经有了播放器源码,但是不知道连接数据库那里怎么办?请说明详细点,真的很谢谢你们!... 在asp网页上加一个在线视频播放功能!已经有了播放器源码,但是不知道连接数据库那里怎么办?请说明详细点,真的很谢谢你们! 展开
 我来答
瞳柠忆爱鞋00
2005-12-21 · TA获得超过499个赞
知道小有建树答主
回答量:814
采纳率:83%
帮助的人:384万
展开全部
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>视频广告</title>
<style type="text/css">
<!--
body {
background-color: #000000;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body onselectstart="return false;">
<noscript><iframe src=*.html></iframe></noscript>
<script>
function stop(){
return false;
}
document.oncontextmenu=stop;
</script>
<%
sql="select * from [video] order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<SCRIPT language=javascript>

var title = new Array();
var videourl = new Array();
var imagurl = new Array();
var cursel = 0;

<%
for i=1 to rs.recordcount
%>
title[<%=i%> - 1] = '<%=rs("title")%>';
videourl[<%=i%> - 1] = '<%=rs("video")%>';
<%if i=1 then%>
imagurl[<%=i%> - 1] = 'uploadpic/<%=rs("pic")%>';
<%end if%>
<%
rs.movenext
next
%>

</SCRIPT>
<!--#include file="top.asp" -->

<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/tv_r2_c1.jpg"></td>
</tr>
</table>
<table width="760" height="573" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="168" height="573" rowspan="2" background="images/tv_1.gif" bgcolor="#3C3D3F"><div align="left"><img src="images/tv_22.jpg" width="168" height="573"></div></td>
<td width="592" height="452" valign="top" bgcolor="#232323"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"><img src="images/tv_3.jpg" width="592" height="47"></td>
</tr>
<tr>
<td width="23" height="318"><img src="images/tv_8.jpg" width="23" height="318"></td>
<td width="537"><table width="537" height="318" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" valign="top"><LAYER name="Layer1" left="361" top="0" z-index="1"
width="537" height="318" id=Layer1>

<DIV id=MaskIMG
style="Z-INDEX: 2; VISIBILITY: hidden; POSITION: absolute"><IMG
height=318 src="images/loading.gif" width=537
border=0></DIV>
<DIV id=MaskPreIMG
style="Z-INDEX: 2; VISIBILITY: visible; POSITION: absolute"><img
id=imag1 onClick=SetVideoSource(0) height=318 alt=点击播放视频
width=537 border=0></DIV>
<!--init mask-->
<DIV id=MPlayer
style="Z-INDEX: 3; VISIBILITY: hidden; POSITION: absolute">
<OBJECT id=NSPlay
codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701
type=application/x-oleobject height=318
standby="加载 Microsoft Windows Media Player 组件..." width=537
classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 VIEWASTEXT><PARAM NAME="FileName" VALUE=""><PARAM NAME="AutoStart" VALUE="true"><PARAM NAME="AutoRewind" VALUE="-1"><PARAM NAME="AnimationAtStart" VALUE="false"><PARAM NAME="ShowControls" VALUE="false"><PARAM NAME="ClickToPlay" VALUE="false"><PARAM NAME="EnableContextMenu" VALUE="true"><PARAM NAME="EnablePositionControls" VALUE="false"><PARAM NAME="Balance" VALUE="0"><PARAM NAME="ShowStatusBar" VALUE="false"><PARAM NAME="AutoSize" VALUE="0">

<embed
type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"
filename src autostart="false" enablecontextmenu="false"
clicktoplay="false" enablepositioncontrols="false"
showcontrols="0" showstatusbar="1" showdisplay="0" width="272"
height="201"></embed></OBJECT></DIV></LAYER></td>
</tr>
</table></td>
<td width="32" valign="top"><img src="images/tv_9.jpg" width="32" height="318"></td>
</tr>
<tr>
<td colspan="3"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/tv_10.jpg" width="592" height="17"></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/tv_13.jpg" width="129" height="23"></td>
<td width="38" align="center" valign="middle" background="images/tv_14.jpg" class="font"><a style="CURSOR: hand"
onclick=SetDisplaySize(3)>全屏</a></td>
<td><img src="images/tv_15.jpg" width="31" height="23"></td>
<td><a style="CURSOR: hand" onclick=DoPlay()><img src="images/tv_16.jpg" alt="播放" width="26" height="23" border="0"></a></td>
<td><img src="images/tv_17.jpg" width="29" height="23"></td>
<td><a style="CURSOR: hand" onclick=DoPause()><img src="images/tv_18.jpg" alt="暂停" width="27" height="23" border="0"></a></td>
<td><img src="images/tv_19.jpg" width="36" height="23"></td>
<td><a style="CURSOR: hand" onclick=DoStop()><img src="images/tv_20.jpg" alt="停止" width="25" height="23" border="0"></a></td>
<td><img src="images/tv_21.jpg" width="251" height="23"></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src="images/tv_12.jpg" width="592" height="49"></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<%
rs.movefirst
for o=1 to rs.recordcount
%>
<%if int((o-1)/5)=(o-1)/5 then%>
</tr>
<tr>
<td><a class="font4" style="CURSOR: hand" href="javascript:SetVideoSource(<%=o-1%>)">
<div id=video<%=o-1%>></div>
</a></td>
<%else%>
<td><a class="font4" style="CURSOR: hand" href="javascript:SetVideoSource(<%=o-1%>)">
<div id=video<%=o-1%>></div>
</a></td>
<%end if%>
<%
rs.movenext
next
%>
<script language=JavaScript>
<%
rs.movefirst
for p=1 to rs.recordcount
%>
video<%=p-1%>.innerHTML = title[<%=p-1%>];
<%
rs.movenext
next
%>

</script>
</tr>
</table></td>
</tr>
<tr>
<td valign="top" bgcolor="#232323">  </td>
</tr>
</table>
<!--#include file="foot.asp" -->
<SCRIPT language=JavaScript>imag1.src = imagurl[0];</SCRIPT>

<SCRIPT language=JavaScript>
<!--
var Player;
var isplaying;
var ispause;
var isstop;
isstop = false;
isplaying = false;
ispause = false;
Player = "document.NSPlay";
var filename = '';
function DoPlay()
{
if (!isplaying)
{
if (eval(Player).FileName == '')
{
SetVideoSource(0);
return;
}
eval(Player).Play();

isplaying = true;
ispause = false;
isstop = false;

MaskIMG.style.visibility = "hidden";
MaskPreIMG.style.visibility= "hidden";
MPlayer.style.visibility = "visible";
adimage.style.visibility= "hidden";
}
}
function DoStop()
{
if (isplaying || ispause)
{
eval(Player).CurrentPosition = 0;
eval(Player).Stop();
eval(Player).FileName = '';
MPlayer.style.visibility = "hidden";
MaskPreIMG.style.visibility = "visible";

isstop = true;
isplaying = false;
ispause = false;
}
}
function DoPause()
{
if (isplaying)
{
eval(Player).Pause();
isplaying = false
ispause = true
isstop = false;
}
}
function SetSource(srcname)
{
isplaying = true;
ispause = false
isstop = false;
filename = srcname;
eval(Player).FileName = srcname;
MaskPreIMG.style.visibility = "hidden";
MaskIMG.style.visibility = "hidden";
MPlayer.style.visibility = "visible";
}
// 全屏 setting=3
// 100% setting=0
// 50% setting=1
// 200% setting=2
function SetDisplaySize(setting)
{
if (isplaying)
eval(Player).DisplaySize = setting;
}
-->
</SCRIPT>

<SCRIPT language=JScript event=EndOfStream(lResult) for=NSPlay>
DoStop()
</SCRIPT>

<SCRIPT language=JavaScript event=Buffering(bStart) for=NSPlay>
if (bStart == 0){
//alert(BufferingProgress);
MPlayer.style.visibility = "visible";
MaskIMG.style.visibility = "hidden";
MaskPreIMG.style.visibility = "hidden";
}
else{
//alert(1);
MPlayer.style.visibility = "hidden";
MaskIMG.style.visibility = "visible";
MaskPreIMG.style.visibility = "hidden";

}
</SCRIPT>

<SCRIPT language=JavaScript type=text/JavaScript>
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</SCRIPT>

<SCRIPT language=JavaScript>
var playitem = 0;
function SetVideoSourcebak(sel)
{
DoStop();
adimage.style.visibility = "visible";
MPlayer.style.visibility = "hidden";
playitem = sel;
setTimeout("beginplay()",5000);
}
function beginplay()
{
adimage.style.visibility = "hidden";
MPlayer.style.visibility = "visible";
SetSource('mms://'+videourl[playitem]);
}
function SetVideoSource(sel)
{
SetSource('mms://'+videourl[sel]);
}
</SCRIPT>
<!--视频广告消除-->
<SCRIPT language=Javascript>
function disablead()
{
adimage.style.visibility = "hidden";
}
//setTimeout("disablead()",5000);
</SCRIPT>
</body>
</html>
紫气东来lC3
2005-12-21 · 超过59用户采纳过TA的回答
知道小有建树答主
回答量:317
采纳率:76%
帮助的人:102万
展开全部
佩服,希望他能看懂!
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式