问题描述:
我想在music页面上点“试听”就把musiame这个参数传到play进行播放音乐,点“试听”也能到play页面,但是播放器里显是的是“准备就绪”
music的连接代码
<td align=center valign="middle" bgcolor="#000000"><span class="style10 style4"><a href="play?music=<%=rs("music")%>">试听<a></span></td>
play( 这个页面的代码是从网上考的,就改了一点点)
<!--#include file="config.inc"-->
<% dim musiame
musiame=request.QueryString("musiame")
set rs=server.CreateObject("adodb.recordset")
sql="select * from music where musiame='"&musiame &"'"
rs.open sql,conn,1,1
%>
<>
<head>
<meta -equiv="Content-Type" content="text/charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<object id="MediaPlayer1" width=460 height=68 classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
codebase="[url=activex.microsoft/activex/controls/mplayer/en/n *** p2inf.cab#Version=6]activex.microsoft/activex/controls/mplayer/en/n *** p2inf.cab#Version=6,4,5,715"
align="baseline" border=0 standby="Loading Microsoft Windows Media Player ponents..."
type="application/x-oleobject">
<param name=invokeURLs value="0">
<param name=FileName value="<% Response.Write rsqumu("musiame")%>">
<param name=ShowControls value="1">
<param name=ShowPositionControls value="0">
<param name=ShowAudioControls value="1">
<param name=ShowTracker value="1">
<param name=ShowDisplay value="0">
<param name=ShowStatusBar value="1">
<param name=AutoSize value="0">
<param name=ShowGotoBar value="0">
<param name=ShowCaptioning value="0">
<param name=AutoStart value="1">
<param name=PlayCount value="0">
<param name=AnimationAtStart value="0">
<param name=TransparentAtStart value="0">
<param name=AllowScan value="0">
<param name=EnableContextMenu value="1">
<param name=ClickToPlay value="0">
<param name=DefaultFrame value="datawindow">
<embed src=music/<% Response.Write rs(musiame")%>" align=baseline border=0 width=460 height=68
type="application/x-mplayer2"
pluginspage="microsoft/isapi/redir.dll?prd=windows&*** p=mediaplayer&ar=media&*** a=plugin&"
name="MediaPlayer" showcontrols="1" showpositioncontrols="0"
showaudiocontrols="1" showtracker="1" showdisplay="0"
showstatu *** ar="1"
autosize="0"
showgotobar="0" showcaptioning="0" autostart="1" autorewind="0"
animationatstart="0" transparentatstart="0" allowscan="1"
enablecontextmenu="1" clicktoplay="0"
defaultframe="datawindow" invokeurls="0">
</embed>
</object>
</body>
</>
数据库里music表里有musiame这个字段,存的是文件名(如:眼泪.wma)
解析:
播放的应该是完整的URL
就是...../眼泪.wma
而且建议文件名都最好用英文字姆。
音乐播放器跟asp.net没啥关系主要是HTML你只要会在HTML插入音乐播放器就能在ASP.NET中插入音乐播放器了网上有很多博客都嵌入了FLASH的播放器你可以研究一下他们的HTML然后拷贝出关键的代码放到自己的网站张去欢迎分享,转载请注明来源:内存溢出
评论列表(0条)