Jplayer.swf takes minutes to load in IE 9 and IE 10

101 views
Skip to first unread message

Michael Heigl

unread,
Apr 17, 2014, 6:58:50 AM4/17/14
to jpl...@googlegroups.com
Hi!

First of all: Many thanks for this great video player!

A bug which was reported to us is related to Internet Explorer 9 and 10. In these browsers the Jplayer.swf filet takes about 2 minutes before it gets loaded. In IE 8 and IE 11 the .swf file was loaded immediately. This behaviour is reproducable on your demo site with IE9/10: http://jplayer.org/latest/demo-01-video-solution-flash-html/

During investigation of the issue we found out that this seems to be related to a missing "classid" attribute on the <object> tag (for example a similar bug in SWFUpload: https://code.google.com/p/swfupload/issues/detail?id=371&can=1&q=IE9&colspec=ID%20Type%20Status%20Summary%20FixReleasedIn%20FixTargetedFor%20Modified).

Unfortunately it is not enough to just add the classid by using the setAttribute method. There is a good (but long) article explaining the different problems with adding the classid attribute in IE9: http://pipwerks.com/2011/05/30/using-the-object-element-to-dynamically-embed-flash-swfs-in-internet-explorer/

The (quick) solution was to add another else statement for IE 9 and 10 to the jplayer.js where the <object> Tag is written to the page and add the HTML code at once:

if($.jPlayer.browser.msie && (Number($.jPlayer.browser.version) < 9 || $.jPlayer.browser.documentMode < 9)) {
    ....
} else if ($.jPlayer.browser.msie && (Number($.jPlayer.browser.version) < 11 || $.jPlayer.browser.documentMode < 11)) {
    var objStr = '<object id="' + this.internal.flash.id + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0" tabindex="-1">'
        + '<param name="movie" value="' + this.internal.flash.swf + '" />'
        + '<param name="FlashVars" value="' + flashVars + '" />'
        + '<param name="allowScriptAccess" value="always" />'
        + '<param name="bgcolor" value="' + this.options.backgroundColor + '" />'
        + '<param name="wmode" value="' + this.options.wmode + '" />'
        + '</object>';
                       
    htmlObj = $(objStr)[0];
} else {
    ...
}

 This is just a quick fix which seems to be working - I guess it should be possible to use the same code for IE 8 but we wanted to be sure to just change the behviour for IE9 and IE10.

Cheers,
Michael

Mark Panaghiston

unread,
Apr 18, 2014, 11:46:54 AM4/18/14
to jpl...@googlegroups.com
Thank you for the report...

I have been reviewing your links and post and have been going over the swfObject code again... Apparently, I had assumed that IE9 became a "Well behaved browser" rather than use the blanket IE solution.

I am a little perplexed as to how this bug exists though. I developed and tested that SWF insertion code using IE9 on Win 7. The IE document mode addition was added around IE10... Maybe late IE9... And I never saw this problem once.

Any tips on how to reproduce it?
Simply using IE9 does not cut it... I am using the VM from modern.ie for IE9 on Win 7... Running on VirtualBox for Mac.
Demo used: http://jplayer.org/latest/demo-01-video-solution-flash-html/

I wonder if the version of Flash installed makes a difference?
 - I literally just downloaded the VM, started it and installed Flash and then tested... And it worked using the Flash solution.
Reply all
Reply to author
Forward
0 new messages