I’ve started to use swfobject for flash videos on my blog. The problem is, each time I use it, it also uses a ID. Which means if you have more than 1 flash video on the same page, only 1 of the videos will work.
The inner DIV that contains the Flash Video, has ID=“player”. ID’s have to be unique and because it’s not, only the first video on the page will show properly. Is there anyway around this? Without having to rename the ID each time?
<div class="flashvideo">
<script type="text/javascript" src="<a href="http://www.gaydemon.com/directory/flv/swfobject.js%22%3E%3C/script">http://www.gaydemon.com/directory/flv/swfobject.js"></script</a>>
<div id="player"><div id="noflash"><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Click here to install Flash</a></div></div>
<script type="text/javascript">
var so = new SWFObject('http://www.gaydemon.com/directory/flv/mediaplayer.swf','mpl','400','300','8');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','false');
so.addParam('wmode','transparent');
so.addVariable('height','300');
so.addVariable('width','400');
so.addVariable("file","http://www.gaydemon.com/blogs/pictures/2008/07/JamieKnightandWyatt_18andUpStuds.flv");
so.addVariable("image","http://www.gaydemon.com/blogs/pictures/2008/07/JamieKnightandWyatt_18andUpStuds.jpg");
so.write('player');
</script>
</div>
What I’m looking for is a way that doesnt require IDs. Because I just know I will forget to change it each time. I can see the code uses the ID to know where to display the video, but there must be some other way to do it.