我有3个视频放在首页上面,当我点击第一个按钮的时候播放第一个,点第二个的时候播放第二个,第三个也一样,然后默认播放的是第一个
我的视频代码:
<div id="player1"></div>
<script language="JavaScript">var s1 = new SWFObject('/Templets/images/flvplayer.swf','single','245','188','7');s1.addParam('allowfullscreen','true');s1.addVariable('file','/Templets/images/VTS_01_1-1.flv');s1.addVariable('image','/Templets/Images/sp_pic.jpg');s1.write('player1');</script>
语言用JS写
<div id="player1"></div>
<script language="JavaScript">
var s1 = new SWFObject('/Templets/images/flvplayer.swf','single','245','188','7');
s1.addParam('allowfullscreen','true');
s1.addVariable('file','/Templets/images/VTS_01_1-1.flv');
s1.addVariable('image','/Templets/Images/sp_pic.jpg');
var s2 = new SWFObject('/Templets/images/flvplayer.swf','single','245','188','7');
s2.addParam('allowfullscreen','true');
s2.addVariable('file','/Templets/images/VTS_01_1-1.flv');
s2.addVariable('image','/Templets/Images/sp_pic.jpg');
var s3 = new SWFObject('/Templets/images/flvplayer.swf','single','245','188','7');
s3.addParam('allowfullscreen','true');
s3.addVariable('file','/Templets/images/VTS_01_1-1.flv');
s3.addVariable('image','/Templets/Images/sp_pic.jpg');
function sele(n)
{
if(n=="1")
s1.write('player1');
else if(n=="2")
s2.write('player1');
else
s3.write('player1');
}
sele("1");
</script>
<div onclick="sele('1');">1</div><div onclick="sele('12');">2</div><div onclick="sele('3');">3</div>
我也做过你这个功能 但是方法和你不怎么一样
<a href='<%=Request.FilePath %>?mname=<%#Eval("lianjie") %>'><%#Eval("title") %></a>
这个是链接 链接里面绑定的是从数据库里读出来的视屏路径 传值给播放器控件
function LoadMusic(FilePath)
{
document.getElementById("player").setAttribute("url",FilePath);
}
</script>
这段代码是接收值接收值
我用的是asp.net
用其他软件的话用法都这样吧