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 comment:1
owner: | → russell.uresti@gmail.com |
---|---|
status: | new → pending |
Changed January 19, 2011 10:51PM UTC by comment:2
status: | pending → new |
---|
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 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 comment:4
Here's a glimpse into what's happening: see the quotes? the url and all the attrs are getting effed up..
Changed January 19, 2011 11:03PM UTC by 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 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 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 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 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 comment:10
component: | unfiled → manipulation |
---|---|
keywords: | → needsreview |
status: | new → open |
Changed April 22, 2011 02:03AM UTC by comment:11
keywords: | needsreview |
---|---|
resolution: | → cantfix |
status: | open → closed |
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.
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!