audiojs icon indicating copy to clipboard operation
audiojs copied to clipboard

Broken in IE<9. Possibly outerHTML?

Open jeffhume opened this issue 13 years ago • 10 comments

I'm having trouble getting this to work in IE versions < 9. Strangely, however, it works in some situations and not others. I can't make sense of why.

Currently the player doesn't work and throws up a generic javascript error at http://iplawpodcast.jurisdiction.com. Strangely, however, it does work at http://iplawpodcast.jurisdiction.com/testing/index.html

It uses the exact same audio.min.js file. I modified it to take out some of the styles for my own purposes but when I use the original file directly downloaded from here it has the same problem.

I can't figure out why it would work on this one page but not the other. The page it doesn't work on is a wordpress page, but it has a very limited template. I'm not even loading in any other javascript except for an html5 shiv. When I remove that though the error persists, so it doesn't appear to be a conflict with that.

It brings up a generic IE javascript error alert saying the error is at line 10 character 446. At that point in the file the code is:

b.outerHTML=d.outerHTML;d=document.getElementById(c)}else{d.appendChild(e);

I found something else referencing outerHTML issues (https://github.com/kolber/audiojs/pull/33), but it appears to be fixed so I'm not sure if this problem is related or not.

Any help or advice would be much appreciated. I apologize if it's something straightforward, but I can't figure it out.

Thanks very much. It's a great player.

jeffhume avatar Apr 23 '12 20:04 jeffhume

I concur I to am see problems with IE 8 and IE 7 Using the IE debugger it's at 272 char 9 (uncompressed version)

271 wrapper.appendChild(newElement); 272-> element.outerHTML = wrapper.outerHTML; 273 wrapper = document.getElementById(id);

dmyers2004 avatar May 10 '12 15:05 dmyers2004

I'm getting errors in IE8 as well, and I'm just viewing it's homepage: http://kolber.github.com/audiojs . Something must have broken because of other changes because I assume it must have worked at some point since IE7 and IE8 is what this plugin is really all about.

faceyspacey avatar May 25 '12 02:05 faceyspacey

The error is in jscript at line 49:

49-> return eval instance.callfunction...

faceyspacey avatar May 25 '12 02:05 faceyspacey

This is the common solution for this issue: http://zaalabs.com/2011/01/adobe-flash-externalinterface-issues-with-internet-explorer/

but that's not the case here, since pplay() is the name of the function used, not play().

faceyspacey avatar May 25 '12 04:05 faceyspacey

nevermind. it was because i was in a virtual machine and sound wasnt working in general. sorry.

faceyspacey avatar May 30 '12 06:05 faceyspacey

I had my audio element inside a paragraph which caused IE to throw this error. Fixed by changing <p> to <div>

ronansprake avatar Aug 29 '12 10:08 ronansprake

ronansprak: Thanks, it's help to me.

razumeiko avatar Sep 29 '12 09:09 razumeiko

@ronansprake Thank YOU!!

swinggraphics avatar Feb 22 '13 21:02 swinggraphics

So I get this error in IE7 on VirtualBox running Vista and IE7. I don't get this error on my test machine with XP and IE7. Not only in my own usages of audio.js, but also the audio.js homepage delivers the same results in Virtual environment versus real environment.

davewallace avatar Nov 11 '13 21:11 davewallace

Yeah, I see to be having the same issue. For me IE8 keeps reporting a the error 'parentNode' is null or not an object. In the uncompressed version, it is Line 584, character 5. Having traced it through the calls, it seems the issue is coming from the createPlayer() function call:

// Tracing this out in IE8 debugger reveals it returns a length of 0...
return wrapper.getElementsByTagName('audio')[0];

It can't seem to find the <audio> element. Weird thing is that like other users this works fine when I have the player (like the example pages), but when I have a string created, injected, then later initialize the player it throws this issue.

listao avatar May 15 '15 17:05 listao