0

For some reason Internet Explorer 8 and below does not run JWPlayer and I have referenced everything correctly. Why won't video work on jwplayer?

It seems as if jwplayer isn't even loading in IE8 or below.

Can you somebody help me?

1 Answers1

0

window.outerWidth is undefined in IE8, therefor your conditional evaluates to false and the JWPlayer code never runs.

Really not that hard to have debugged yourself. A simple alert or console.log in the conditional shows it isn't running, then you deduce it might be because the conditional itself is evaluating wrong, then a simple alert or console.log of window.outerWidth shows it is undefined.

Same problem with a potential solution: https://stackoverflow.com/a/5954761/1217408

Using document.body.clientWidth as pointed out there, something like this should work:

if((window.outerWidth && window.outerWidth > 640) || (document.body.clientWidth && document.body.clientWidth > 640)){

You should keep in mind that in IE this might include the scrollbar when calculating the available width. They are not exactly equivalent but if you're careful or mindful of it then you shouldn't have any problem.

Community
  • 1
  • 1
TheZ
  • 3,663
  • 19
  • 34
  • Wow, I should of start there. Thank you so much. But how do I fix it? lol. I am not a huge JavaScript guru. –  Oct 19 '12 at 23:40
  • @Anonymous Added an example solution. – TheZ Oct 19 '12 at 23:43
  • You are a savior, can you pay you via PayPal? This was that crucial. –  Oct 19 '12 at 23:51
  • @Anonymous Don't worry about it, StackOverflow is here to help :) – TheZ Oct 19 '12 at 23:54
  • I am not understanding what the solution is. Do I need to put the jwplayer call inside the above listed if condition? – Jake Aug 06 '13 at 21:08