Skip to main content

Bug Tracker

Side navigation

#8015 closed bug (cantfix)

Opened January 19, 2011 10:21PM UTC

Closed April 22, 2011 02:03AM UTC

Wrap method on HTML5 video element breaking in iPad / iPhone

Reported by: russell.uresti@gmail.com Owned by: russell.uresti@gmail.com
Priority: undecided Milestone: 1.next
Component: manipulation Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

Using wrap() on an an HTML5 video element is causing the video not to be playable on iPad and iPhone devices.

ex. code:

$('#movieElement').wrap('<div />');

There doesn't seem to be a problem with this in desktop Safari, but in Mobile Safari it prevents the video from loading / playing. It just shows a black box area.

I should note that the video tag had source tags inside of it (for different codecs). Not sure if that would make a difference or not, but worth mentioning.

Attachments (0)
Change History (11)

Changed January 19, 2011 10:33PM UTC by rwaldron comment:1

owner: → russell.uresti@gmail.com
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced jsFiddle test case to help us assess your ticket!

Additionally, test against the jQuery 0 GIT version to ensure the issue still exists. Be Excellent to eachother!

Changed January 19, 2011 10:51PM UTC by russell.uresti@gmail.com comment:2

status: pendingnew

Replying to [comment:1 rwaldron]:

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced jsFiddle test case to help us assess your ticket! Additionally, test against the jQuery 0 GIT version to ensure the issue still exists. Be Excellent to eachother!

I have created a JSFiddle link here: http://jsfiddle.net/ReqcW/

However, this code will function correctly, even when viewed on the iPad. However, when placed into a true HTML page, it will not function.

Here is a link to a JSBin (which accurately shows the error) : http://jsbin.com/uyohi4/edit

Changed January 19, 2011 10:54PM UTC by danheberden comment:3

oh jsfiddle can do that, just not as well documented: http://jsfiddle.net/ReqcW/show/

Changed January 19, 2011 11:00PM UTC by danheberden comment:4

Here's a glimpse into what's happening: see the quotes? the url and all the attrs are getting effed up..

http://gyazo.com/29543d0e43246c033010abf346336439.png

Changed January 19, 2011 11:03PM UTC by anonymous comment:5

Replying to [comment:3 danheberden]:

oh jsfiddle can do that, just not as well documented: http://jsfiddle.net/ReqcW/show/

Got a result that said "error : please use POST request" when viewing on the iPad. I think I prefer JSBin. JSFiddle has rendered multiple things inaccurately for me, while JSBin has never got anything wrong (for me, personally).

Changed January 19, 2011 11:06PM UTC by russell.uresti@gmail.com comment:6

Replying to [comment:4 danheberden]:

Here's a glimpse into what's happening: see the quotes? the url and all the attrs are getting effed up.. http://gyazo.com/29543d0e43246c033010abf346336439.png

Ohhh, I see. Yeah, the "type" attribute requires double quotes (for the codec) nested inside the overall attribute.

ex. type='video/mp4; codec="avc1.42E01E, mp4a.40.2"'

I can see the double quote thing would mess it up.

Changed January 19, 2011 11:12PM UTC by russell.uresti@gmail.com comment:7

Replying to [comment:6 russell.uresti@…]:

Replying to [comment:4 danheberden]: > Here's a glimpse into what's happening: see the quotes? the url and all the attrs are getting effed up.. > > http://gyazo.com/29543d0e43246c033010abf346336439.png Ohhh, I see. Yeah, the "type" attribute requires double quotes (for the codec) nested inside the overall attribute. ex. type='video/mp4; codec="avc1.42E01E, mp4a.40.2"' I can see the double quote thing would mess it up.

Actually, thinking on that, if the quotes were the problem, it would probably be reflected in Firefox, Chrome, Safari, and other desktop browsers. This problem only occurs in iPad and iPhone (and perhaps other mobile devices). I think that syntax is created by FirebugLite, and not an accurate reflection of the DOM. For example, the "controls" attribute does not have values to set it to, so it's not "controls=""". It's just "controls".

Changed January 19, 2011 11:17PM UTC by danheberden comment:8

yeah, escaping the quotes didn't help at all.

Interesting, the problem is on moving the node at all: http://jsfiddle.net/danheberden/ReqcW/7/show/

inspecting the element shows it's still a vid tag with all the goodies, but, hmmm

Changed January 20, 2011 03:35AM UTC by russell.uresti@gmail.com comment:9

Replying to [comment:8 danheberden]:

yeah, escaping the quotes didn't help at all. Interesting, the problem is on moving the node at all: http://jsfiddle.net/danheberden/ReqcW/7/show/ inspecting the element shows it's still a vid tag with all the goodies, but, hmmm

I had initially thought the culprit was innerHTML, but I don't think that's the case. After some testing, here are two ways to replicate the desired result, just done with native JavaScript.

Without innerHTML : http://jsbin.com/uyohi4/6/edit

With innerHTML : http://jsbin.com/uyohi4/5/edit

Both appendChild and innerHTML seem to work just fine.

Changed January 24, 2011 08:29PM UTC by rwaldron comment:10

component: unfiledmanipulation
keywords: → needsreview
status: newopen

Changed April 22, 2011 02:03AM UTC by dmethvin comment:11

keywords: needsreview
resolution: → cantfix
status: openclosed

Based on the last repro cases it seems like this is a bug in Safari and not a jQuery issue. Similar problems occur with iframes and we haven't been able to create workarounds.