IE SCRIPT16389 Error with Flash ExternalInterface Callback and JQuery Slider
I'm having a really odd issue with Internet Explorer, on my website I'm using the JQuery AnythingSlider plugin to display some videos. Whenever someone slides to the next video, I have a flash call back:
import flash.external.ExternalInterface;
ExternalInterface.addCallback("movie_pause",player.pause);
and:
var obj = swfobject.getObjectById($(this).attr('id'));
if(obj){
obj.movie_pause(); //This is where the error takes place
}
Now the weird thing is, when the page is first loaded, everything runs fine. However after a refresh, or just randomly after sliding a couple of times, IE starts throwing error SCRIPT16389: Unspecified Error and points to the above line. But if I am debugging with IE, it instead points to:
function __flash_addCallback(instance, name) {
instance[name] = function() {
return eval(instance.CallFunction("<invoke name=\""+name+"\" returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) + "</invoke>"));
}
}
I'm embedding my videos using swfObject:
<object id="testimonial_{testimonials_ID}"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="720" height="480">
<param name="movie" value="<?php echo content_url();?>videos/player/agflvplayer.swf">
<param name=FlashVars value="id=testimonial_{testimonials_ID}&flvurl=<?php
echo content_url();?>{testimonials_url}&player_skin=<?php
echo content_url开发者_Python百科();?>videos/player/SkinOverAllNoCaption.swf&volume=0">
<param name="wmode" value="transparent">
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="<?php echo content_url();?>videos/player/agflvplayer.swf" width="720" height="480">
<param name=FlashVars value="id=testimonial_{testimonials_ID}&flvurl=<?php
echo content_url();?>{testimonials_url}&player_skin=<?php
echo content_url();?>videos/player/SkinOverAllNoCaption.swf&volume=0">
<param name="wmode" value="transparent">
<!--<![endif]-->
<p>Alternative content</p>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
You can take a look at the issue http://people.oregonstate.edu/~egliju/agtools/welcome/test/'>http://people.oregonstate.edu/~egliju/agtools/welcome/test. Nearest issue I could find is ExternalInterface not working in IE after page refresh but there is no answer(they just recommend using swfobject, which I am).
Alright, it seems I've figured out a way around the issue. It seems it has to due with Internet Explorer caching the flash player and for some reason, that causes problems. So I tricked it into reloading itself every time by changing the movie param url to something different for every player.
<param name="movie" value="player/player.swf?no_cache=<?php echo rand();?>">
精彩评论