请问如何在ASP.NET的页面加入多媒体播放器播放视频(C#)?
用的是c#,在一个页面点击链接后到一个新页面播放多媒体?请各位大侠指教! --------------------编程问答-------------------- 表达不清晰你是不知道怎么做视频播放还是
连接到另一个页面让他一连接过去就开始播放??? --------------------编程问答-------------------- <embed type="audio/x-pn-realaudio-plugin" id="player" controls="ImageWindow,ControlPanel"
width="234" height="183" border="0">
这个控件..不过有些格式不支持.. --------------------编程问答-------------------- mark --------------------编程问答-------------------- 如果是需要视频控件的话,网上可以下,你去baidu/google搜一下!
我这有个例子要的话可以发给你,但是我下的控件很lj,只能支持wma --------------------编程问答-------------------- 来个realplayer的例子:
预览页——
function play(id)
{
OpenWindow('play.html?tid='+id);
}
</script>
<a href="javascript:play('http://202.104.94.59/photos/1166611/rfm/upfiles2/200741694540.mp3')"> <b><font color="#808080">测试01</font></b></a>
播放页——
<body bgcolor="#000000" text="#ffffff" leftmargin="0" topmargin="0" onload="window.moveTo(80,80)">
<!--** player begin **-->
<table width="100%" height="100%" border="1" cellpadding="0" cellspacing="0" ID="TablePlayer">
<tr>
<td align="center"><object id=RP1 height="100%" width="100%" classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA name=RP1 >
<PARAM NAME="_ExtentX" VALUE="26564">
<PARAM NAME="_ExtentY" VALUE="15452">
<PARAM NAME="AUTOSTART" VALUE="-1">
<PARAM NAME="SHUFFLE" VALUE="0">
<PARAM NAME="PREFETCH" VALUE="0">
<PARAM NAME="NOLABELS" VALUE="0">
<PARAM NAME="CONTROLS" VALUE="Imagewindow">
<PARAM NAME="CONSOLE" VALUE="clip1">
<PARAM NAME="LOOP" VALUE="0">
<PARAM NAME="NUMLOOP" VALUE="0">
<PARAM NAME="CENTER" VALUE="0">
<PARAM NAME="MAINTAINASPECT" VALUE="0">
<PARAM NAME="BACKGROUNDCOLOR" VALUE="#000000">
</OBJECT></td><!--main window-->
</tr>
<tr>
<td height="60">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" ID="Table2">
<td align="center" bgcolor="#000000"> <table border=1 cellpadding=0 cellspacing=0 width="100%" ID="Table3">
<td width="50"><img src="images/ctrl-fullscreen.gif" alt="全屏播放" width="50" height="30" border="0" onClick="document.RP1.SetFullScreen()"></td>
<td>
<script>
var objctrl="<object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=30 id='RP2' name='RP2' width=100% VIEWASTEXT><param name='_ExtentX' value='4657'><param name='_ExtentY' value='794'><param name='AUTOSTART' value='-1'><param name='SHUFFLE' value='0'><param name='PREFETCH' value='0'><param name='NOLABELS' value='-1'>";
var u=document.location.toString();
var id=u.substring(u.lastIndexOf("tid=")+4, u.length);
objctrl +="<param name='SRC' value='"+id+"'>";
objctrl +="<param name='CONTROLS' value='ControlPanel'><param name='CONSOLE' value='clip1'><param name='LOOP' value='0'><param name='NUMLOOP' value='0'><param name='CENTER' value='0'><param name='MAINTAINASPECT' value='0'><param name='BACKGROUNDCOLOR' value='#000000'></object>";
document.write(objctrl);
</script>
</td><!--control window-->
</table>
</td>
<tr>
<td align="center" bgcolor="#000000"><object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=30 id="RP3" name="RP3" width=100% >
<param name="_ExtentX" value="4657">
<param name="_ExtentY" value="794">
<param name="AUTOSTART" value="-1">
<param name="SHUFFLE" value="0">
<param name="PREFETCH" value="0">
<param name="NOLABELS" value="-1">
<param name="CONTROLS" value="StatusBar">
<param name="CONSOLE" value="clip1">
<param name="LOOP" value="0">
<param name="NUMLOOP" value="0">
<param name="CENTER" value="0">
<param name="MAINTAINASPECT" value="0">
<param name="BACKGROUNDCOLOR" value="#000000">
</object></td><!--status window-->
</tr>
</table></td>
</tr>
</table>
<!--** player end **-->
--------------------编程问答-------------------- <TD align="center" colSpan="3">
<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="MediaPlayer1" style="width: 344px; height: 312px">
<param name="Filename" value="" id="Filename"/ >
<param name="PlayCount" value="1"/>
<param name="AutoStart" value="1"/>
<param name="ClickToPlay" value="1"/>
<param name="DisplaySize" value="0"/>
<param name="EnableFullScreen Controls" value="1"/>
<param name="ShowAudio Controls" value="1"/>
<param name="EnableContext Menu" value="1"/>
<param name="ShowDisplay" value="1"/>
</object>
</TD>
我在HTML加了这段代码,但如何动态获取文件名? --------------------编程问答-------------------- 其实跟C#无关的 --------------------编程问答-------------------- 不同的多媒体采用不同的object,查查资料,很简单,这是html知识 --------------------编程问答-------------------- 我的例子里是参数传递进入url信息——
play.html?tid=xxxx.mp3
播放页play.html里:
var u=document.location.toString();
var id=u.substring(u.lastIndexOf("tid=")+4, u.length);
objctrl +="<param name='SRC' value='"+id+"'>";
.... --------------------编程问答-------------------- jf up 学习 --------------------编程问答-------------------- up --------------------编程问答--------------------
<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" id="aboutplayer" width="251" height="62">
<param name="URL" value="<%=strUrlSong %>" />
<param name="FileName" value="<%=strFileList %>" />
<param name="volume" value="100"/>
<param name="autoStart" value="<%=allowAutoplay %>"/>
<param name="playCount" value="100"/>
<param name="enablecontextmenu" value="0"/>
<param name="enableerrordialogs" value="0"/>
</object><!--播放器-->
用个方法给播放器赋值可以么 --------------------编程问答-------------------- mark --------------------编程问答-------------------- 我正在做这个东西呢 看看做出来了来跟你说吧 --------------------编程问答-------------------- mark --------------------编程问答-------------------- 可以接分么???????? --------------------编程问答--------------------
<object id="player_ie"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
width="400" height="260">
<param name="movie" value="http://www.flash88.net/flash882004y12y9auto3ty/g5/32.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent" />
<param name="allowFullScreen" value="true" />
<param name="align" value="center" />
<param name="scale" value="exactfit" />
<embed id="player_ff" src="http://www.flash88.net/flash882004y12y9auto3ty/g5/32.swf"
wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="400" height="260" allowfullscreen="true"></embed>
</object>
尝试了一下可以用,播放的是swf格式的文件 --------------------编程问答-------------------- 把html中播放的代码直接放到.aspx中即可。 --------------------编程问答-------------------- mark --------------------编程问答-------------------- 这个好像真的跟C#没关系!!! 到网上去当个控件吧!!! --------------------编程问答-------------------- 擦 我当初也以为是和语言有关系 你可以看看点播系统是怎么做的就好
补充:.NET技术 , ASP.NET