Arggh…I have the concept worked out, I just need help getting the code syntax correct.
I want to create a page where it will sniff out the platform of the user (Mac or PC) and on that criteria choose either a Quicktime (for Mac) or a Windows Media (for PC) video file to play embedded in that page.
What I can’t figure out is how to incorporate a Javascript object into an EMBED tag (if that is in fact how to do it). I can guess that the variable would go here: <EMBED src=”variable”…, but I’m unsure of the syntax.
Here’s the script I have so far…
<SCRIPT language=”Javascript” type=”text/javascript”>
<!–
var bname=navigator.platform;
var vidtype;
if(bname==”MacPPC”)
{
vidtype=”../videos/adrienne.mov”
}
else
{
vidtype=”../videos/adrienne.wmv”
}
//–>
</SCRIPT>
So, now how can I get the EMBED tag to use the variable to play that video. The value is being set, but the video won’t load, much less play. This video is not playing in it’s own window – it needs to be embedded within an HTML with graphics and text around it.
Thanks in advance for ANY help!!!
-adinanet