[wp-trac] [WordPress Trac] #31058: audio video previews JS errors in IE 8

WordPress Trac noreply at wordpress.org
Tue Feb 10 04:20:58 UTC 2015


#31058: audio video previews JS errors in IE 8
--------------------------+-----------------------------
 Reporter:  afercia       |       Owner:  wonderboymusic
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  4.1.1
Component:  Media         |     Version:  4.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  javascript
--------------------------+-----------------------------

Comment (by dd32):

 Seems like the fix ([attachment:mediaelement-and-player.js.diff
 mediaelement-and-player.js.diff]) is correct, the problem is due to us
 instantiating mediaelement on `<audio|video>` tags that aren't yet part of
 the main DOM, this is something that we should open a PR upstream for.
 In Chrome (if I force it down the flash route) it hits this case but
 `node.parentNode` is null (instead of IE, where it's a node with no real
 context).

 The Mediaelementjs.com and front-end views aren't affected, as the
 elements are within the page already, so it can easily find the `<body>`
 element and break out of the loop.

 Since I didn't really like the idea of shipping a new/patched mediaelement
 `mediaelement-and-player.min.js` file in 4.1.1, and we've already modified
 `media-audiovideo.js`, i've monkey patched it in [attachment:31058.monkey-
 patch.diff 31058.monkey-patch.diff] so that it thinks that the root-level
 element in the virtual dom is a `<body>` tag (I couldn't simply
 unset/delete/set to null, as IE didn't seem to want to let me).
 This tests fine for me in IE8, and although I can't really see this
 causing any issues, I've not thoroughly tested it against other
 browsers/versions.
 I'd appreciate it if others could weigh in on this, and if these fixes hit
 the right spots or not.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31058#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list