PDA

View Full Version : Question about JW FLV Media Player


LD
2008-11-27, 04:23 PM
I think a couple of people use this, and I have been wanting to use embedded vids on my freesites...so I downloaded it, but I can only get one video per page to work.

On the page below I created two divs, but only one shows. I've tried it without divs, different clips, but still can't seem to get the second one to show up...I also tried moving the <script type='text/javascript' src='/mediaplayer/swfobject.js'></script>
down in the body into each idividual div...no luck.

Here's what I came up with...

http://www.lusciousdelights.com/testplayer5.html

The "clip 2" has identical code...I must be missing something. I would like to be able to put 3 or 4 clips on one web page.

Here's the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.player {
border: medium solid #FF0000;
height: 350px;
width: 470px;
margin-right: auto;
margin-left: auto;
text-align: center;
vertical-align: bottom;
padding: 5px;
clear: both;
margin-top: 7px;
margin-bottom: 7px;
}
-->
</style>
<script type='text/javascript' src='/mediaplayer/swfobject.js'></script>
</head>

<body>
<div class="player">
Clip 1

<div id='preview'>This div will be replaced</div>

<script type='text/javascript'>
var s1 = new SWFObject('/mediaplayer/player.swf','ply','470','320','9','#ffffff');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('wmode','opaque');
s1.addParam('flashvars','file=http://content.bitsontherun.com/videos/3ta6fhJQ.flv');
s1.write('preview');
</script>
</div>

<div class="player">

Clip 2
<div id='preview2'>This div will be replaced</div>

<script type='text/javascript'>
var s1 = new SWFObject('/mediaplayer/player.swf','ply','470','320','9','#ffffff');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('wmode','opaque');
s1.addParam('flashvars','file=http://content.bitsontherun.com/videos/3ta6fhJQ.flv');
s1.write('preview');
</script>
</div>
</body>
</html>

Alex B
2008-11-28, 04:26 AM
For second one - s1.write('preview'); should be s1.write('preview2'); - that's the ID of the div to be replaced

LD
2008-11-28, 09:00 AM
For second one - s1.write('preview'); should be s1.write('preview2'); - that's the ID of the div to be replaced

That it!...thanks so much!

Daniel_webcams
2008-12-09, 04:42 AM
yeah, I had the problem, the ID of the div was the problem. :) but now is solved.