
OBJECT Syntax
How can you use <OBJECT> syntax for setting up JW Player instead of JavaScript?
Here's why I ask. I currently have the following XLS that works perfectly in FireFox, but the the JW Player javascript doesn't work in IE. It looks like the resulting javascript is actually never executed. So I'd like to use the old <OBJECT> syntax instead. That's what I have for Windows media player and it works in both FireFox and IE. Of course if anyone can explain my FireFox problem, I'd certainly like to hear it.
<xsl:choose>
<xsl:when test="$media/@type = 'flash'">
<p><xsl:value-of select="$mediaPath"/></p>
<div id="{$media/@id}"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript">
var s1 = new SWFObject("../flash/player.swf","ply","300","400","9","#FFFFFF");
s1.addParam("allowfullscreen","true");
s1.addParam("allowscriptaccess","always");
s1.addParam("flashvars","file=C:/Documents%20and%20Settings/Brad/My%20Documents/LT/deviewer/devsrc/deroot/public/courses/DEViewer_Tests_en/media/stewardship.swf");
s1.write("<xsl:value-of select="$media/@id"/>");
</script>
</xsl:when>
<xsl:when test="$media/@type = 'msmediaplayer'">
<OBJECT ID="MediaPlayer1" WIDTH="{$finalPlayerWidth}" HEIGHT="{$finalPlayerHeight}" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<PARAM NAME="URL" VALUE="{$mediaPath}"/>
<PARAM NAME="volume" VALUE="0"/>
<PARAM NAME="enabled" VALUE="true"/>
<PARAM NAME="autoStart" VALUE="{$autostart}"/>
<EMBED type="application/x-mplayer2" src="{$mediaPath}" name="MediaPlayer1" width="{$finalPlayerWidth}" height="{$finalPlayerHeight}"/>
</OBJECT>
</xsl:when>
</xsl:choose>
UPDATE: I still have the same question, but I've learned something. It turn out that when generating javascript via xslt you need to have to add defer="defer" to the script tag: <script type="text/javascript" defer="defer">.
Figuring that out helped a little, but IE still blows up saying SWFObject isn't defined. So I still need to know how to use <OBJECT> syntax instead of JavaScript.