Posted by coakeson on June 15, 2011 at 7:56pm
2 followers
| Project: | SWF Embed |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | internet explorer, null value |
Issue Summary
IE 7 & 8 come up with the same error "'null' is null or not an object" when using this module. I've narrowed it down to whatever happens on line 103 of jquery.swfembed.js in both 6x-1.x-dev and 6x-1.4
$(this).html(obj);
The this variable is of course initialized, and obj is a valid string. I'm using JQuery 1.3.2.
What could be going on when adding the object to the DOM?
The $swf variable is initialized like below with the various PHP variables containing correct values. A simple theme call is used to display the flash player.
$swf = new SWFObject('http://player.ooyala.com/player.swf?embedCode=' . $embed_code . '&version=2');
$swf->param('allowFullScreen', 'true')
->param('type','application/x-shockwave-flash')
->param('movie','http://player.ooyala.com/player.swf?embedCode=' . $embed_code . '&version=2')
->param('bgcolor','#000000')
->param('allowScriptAccess','always')
->param('allowFullScreen','true')
->param('wmode','transparent')
->flashVar('maintainAspectRation', 'true')
->flashVar('loop', 'false')
->flashVar('play', 'true')
->flashVar('embedCode', $embed_code)
->flashVar('pluginspage', 'http://www.adobe.com/go/getflashplayer')
->flashVar('wmode', 'transparent')
->height($height)
->width($width)
->noFlash('<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="ooyalaPlayer_6zg0j_gnw0k6wg" width="' . $width . '" height="' . $height . '" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="http://player.ooyala.com/player.swf?embedCode=' . $embed_code . '&version=2" />
<param name="bgcolor" value="#000000" />
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreen" value="true" />
<param name="flashvars" value="embedType=directObjectTag&embedCode=' . $embed_code . '" />
<param name="wmode" value="transparent" />
<embed src="http://player.ooyala.com/player.swf?embedCode=' . $embed_code . '&version=2"
bgcolor="#000000" width="' . $width . '" height="' . $height . '" name="ooyalaPlayer_6zg0j_gnw0k6wg" align="middle"
play="true" loop="false" allowscriptaccess="always" allowfullscreen="true"
type="application/x-shockwave-flash" flashvars="&embedCode=' . $embed_code . '"
pluginspage="http://www.adobe.com/go/getflashplayer" wmode="transparent">
</embed>
</object>
</noscript>')
->minimumVersion('9.0.28');
Comments
#1
I stumbled to the same error using ExternalInterface from flash in IE is not possible and returns "'null' is null or not an object" when the embedded object doesn't have an id.
Provided a patch that fixes the issue both in the PHP module and in the js as well.
WARNING for the author: The patch is against 6.x branch with origin in stable 1.4
#2
Thank you, your patch solved my problem! The only thing that didn't work was the line:
$id_counter=&drupal_static('swfembed_id_counter',1);
I'm using drupal 6, so drupal_static is not defined.