Side navigation
#9174 closed bug (invalid)
Opened May 08, 2011 01:52PM UTC
Closed May 08, 2011 04:09PM UTC
Last modified May 07, 2013 12:30PM UTC
creating video element causes video to play in background, even before adding it to the page
Reported by: | bugs.jquery.com@sembiki.com | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | manipulation | Version: | 1.6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
This happens sometimes, but not all of the time, in Firefox, Safari, and Chrome.
var v = $("<video id='v' src='http://ia600401.us.archive.org/18/items/ForrestPlaysTaik/forresto-plays-taik-banjo-360.webm' autobuffer='auto' preload autoplay controls></video>");
1. Create the video element
2. Hear it playing in background, even though it isn't in the DOM tree
3. Then if you add the element to the page with
.append(v)the audio will be doubled
Attachments (0)
Change History (5)
Changed May 08, 2011 04:09PM UTC by comment:1
component: | unfiled → manipulation |
---|---|
priority: | undecided → low |
resolution: | → invalid |
status: | new → closed |
Changed May 08, 2011 04:41PM UTC by comment:2
Isn't this a valid bug? I need it to autoplay. A workaround is to use
$("#player").html("<video id='v' src='http://ia600401.us.archive.org/18/items/ForrestPlaysTaik/forresto-plays-taik-banjo-360.webm' autobuffer='auto' preload autoplay controls></video>");
instead of
$("#player").append($("<video id='v' src='http://ia600401.us.archive.org/18/items/ForrestPlaysTaik/forresto-plays-taik-banjo-360.webm' autobuffer='auto' preload autoplay controls></video>"));
Changed May 08, 2011 04:52PM UTC by comment:3
This sounds like a browser bug. However, I've tried this before and I believe it will autoplay (whether the attribute is present or not) as soon as you append it so the autoplay attribute may be unnecessary in this case.
Changed May 08, 2011 05:19PM UTC by comment:4
Again, removing the "autoplay" attribute corrects the issue: http://jsfiddle.net/rwaldron/cDpV9/9/
Changed May 07, 2013 12:30PM UTC by comment:5
Seems fixed in jquery 1.9
Try removing the "autoplay" attribute.