Need help with Flash Video / swfobject

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>

Re: Need help with Flash Video / swfobject


<div class="flashvideo">
<script type="text/javascript" src="http://www.gaydemon.com/directory/flv/swfobject.js"></script>
<div id="player"><div id="noflash"><a href="http://www.adobe.com/shockwave/downl...veFlash">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/pictur...andUpStuds.flv");
so.addVariable("image","http://www.gaydemon.com/blogs/pictur...andUpStuds.jpg");
[B]so.write('player');[/B]
</script>
</div>


<div class="flashvideo">
<script type="text/javascript" src="http://www.gaydemon.com/directory/flv/swfobject.js"></script>
<div id="player1"><div id="noflash"><a href="http://www.adobe.com/shockwave/downl...veFlash">Click here to install Flash</a></div></div>
<script type="text/javascript">
var so1 = new SWFObject('http://www.gaydemon.com/directory/flv/mediaplayer.swf','mpl','400','300','8');
so1.addParam('allowscriptaccess','always');
so1.addParam('allowfullscreen','false');
so1.addParam('wmode','transparent');
so1.addVariable('height','300');
so1.addVariable('width','400');
so1.addVariable("file","http://www.gaydemon.com/blogs/pictur...andUpStuds.flv");
so1.addVariable("image","http://www.gaydemon.com/blogs/pictur...andUpStuds.jpg");
[B]so1.write('player1');[/B]
</script>
</div>

Re: Need help with Flash Video / swfobject

so1.write(‘player1’); and so.write(‘player’); are the key. Don’t forget to give another name to the object too.

Re: Need help with Flash Video / swfobject

Thanks, but thats how i fixed it for now.

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.

I do wish there was a easier way!

Thanks anyway!

Re: Need help with Flash Video / swfobject

Can you set the ID to something like the name of the file so it’s always unique?

Unique IDs are pretty much necessary I think.

Re: Need help with Flash Video / swfobject

Is this your new naked video?

Re: Need help with Flash Video / swfobject

i use the name of the video when i do this in WMV.

btw, does anyone know how to link to the video to the site using the above code?