Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB


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:when test="$media/@type = 'flash'">
<p><xsl:value-of select="$mediaPath"/></p>
<div id="{$media/@id}"><a href="">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.write("<xsl:value-of select="$media/@id"/>");
<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}"/>

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.

3 Community Answers

JW Player

0 rated :

I finally found an example of <OBJECT> syntax at

I changed it just a bit to run the sample that comes w/ the player. This code assumes everything is in the same folder. Note this is using swfobject 1.5.

bc.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" lang="en" xml:lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("myFlashContent", "9.0.0");

<object id="player1" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="" width="320" height="240">
<param name=bgcolor value="#FFFFFF">
<param name=movie value="player.swf">
<param name=allowfullscreen value="true">
<param name=allowscriptaccess value="always">
<param name="flashvars" value="file=">
<embed name="player1" type="application/x-shockwave-flash" pluginspage="" width="320" height="240"bgcolor="#FFFFFF" src="player.swf" allowfullscreen="true"allowscriptaccess="always" flashvars="file=video.flv&controlbar=bottom">

JW Player

1 rated :

I never get this to work in IE when the code was generated with XSL. The couldn't get past sfwobject not found errors. Just when I was about to give up, I found the "Scriptless Embedding" example at

bc.. <html>
<title>JW API Example 1-3-2-0 - only Embed code</title>

<embed name="player1" id="player1"
width="320" height="240"


JW Player

0 rated :

Once you use scriptless embedding, how can you go behind and use Javascript to control playback?

This question has received the maximum number of answers.