JWplayer - 一页上有多个玩家

时间:2012-11-12 03:28:21

标签: javascript jquery video flash jwplayer

我在一个页面上有3个视频,但只有第一个加载。

我知道我必须为每个循环创建一个,但我不确定如何去做。谁能指出我正确的方向?感谢

我的页面如下:

<script type="text/javascript" src="jwplayer.js"></script>


<div class="container">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "/jwplayer/player.swf",
file: "vid1.flv",
height: 270,
width: 480
});
</script>


<div class="container">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "/jwplayer/player.swf",
file: "vid2.flv",
height: 270,
width: 480
});
</script>


<div class="container">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "/jwplayer/player.swf",
file: "vid3.flv",
height: 270,
width: 480
});
</script>

1 个答案:

答案 0 :(得分:0)

好的答案很简单......我只给了div个人名字:

EG:

<div id="container1">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container1").setup({
flashplayer: "/jwplayer/player.swf",
file: "vid1.flv",
height: 270,
width: 480
});
</script>


<div id="container2">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container2").setup({
flashplayer: "/jwplayer/player.swf",
file: "vid2.flv",
height: 270,
width: 480
});
</script>