Note that there are some explanatory texts on larger screens.

plurals
  1. POhtml5 video playing twice (audio doubled) with JQuery .append()
    primarykey
    data
    text
    <p>Huge WTF that I thought was a bug hidden in the <a href="http://meemoo.org" rel="noreferrer">semicomplex web app</a> that I'm making, but I have pared it down to the simplest code possible, and it is still replicable in Firefox, Chrome, and Safari, unpredictably but more than 1/2 of the time.</p> <p><a href="http://jsfiddle.net/cDpV9/7/" rel="noreferrer">http://jsfiddle.net/cDpV9/7/</a></p> <pre><code>var v = $("&lt;video id='v' src='http://ia600401.us.archive.org/18/items/ForrestPlaysTaik/forresto-plays-taik-piano-360.webm' autobuffer='auto' preload autoplay controls&gt;&lt;/video&gt;"); $("#player").append(v); </code></pre> <ol> <li>Add a video element.</li> <li>Video starts to load and play.</li> <li>Video audio sounds like it is doubled.</li> <li>Pause the visible video, and one audio track continues.</li> <li>Delete the video element; the ghost audio keeps playing.</li> <li>Delete the frame, and the ghost audio stops (though once in Firefox it continued to play after closing the window, and didn't stop until quitting Firefox).</li> </ol> <p>Here is a screen capture to maybe show that I'm not completely crazy: <a href="http://www.youtube.com/watch?v=hLYrakKagRY" rel="noreferrer">http://www.youtube.com/watch?v=hLYrakKagRY</a></p> <p>It doesn't seem to happen when making the element with <code>.html()</code> instead of <code>.append()</code>, so that's my only clue: <a href="http://jsfiddle.net/cDpV9/6/" rel="noreferrer">http://jsfiddle.net/cDpV9/6/</a></p> <pre><code>$("#player").html("&lt;video id='v' src='http://ia600401.us.archive.org/18/items/ForrestPlaysTaik/forresto-plays-taik-piano-360.webm' autobuffer='auto' preload autoplay controls&gt;&lt;/video&gt;"); </code></pre> <p>I'm on OS X 10.6.7.</p> <hr> <p>I think that I have it. Even just creating the JQuery object without adding it to the page causes the ghost player to play: <a href="http://jsfiddle.net/cDpV9/8/" rel="noreferrer">http://jsfiddle.net/cDpV9/8/</a> </p> <p><code>var v = $("&lt;video id='v' src='http://ia600401.us.archive.org/18/items/ForrestPlaysTaik/forresto-plays-taik-banjo-360.webm' autobuffer='auto' preload autoplay controls&gt;&lt;/video&gt;");</code></p> <p>For now I can work around this by using <code>.html()</code>. I'll report <a href="http://bugs.jquery.com/ticket/9174" rel="noreferrer">the issue</a> to JQuery.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload