On Mon, Jul 20, 2009 at 4:46 PM, David Wilson <span dir="ltr"><<a href="mailto:dw@botanicus.net">dw@botanicus.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
It's easy to see how some naively implemented JS audio widget could<br>
fetch 200mb over an expensive 3G connection, simply by navigating to<br>
some site in a background tab (say, by creating an array of elements<br>
to represent their playlist - something I'd have thought was perfectly<br>
valid behaviour).<br></blockquote><div><br>In your case even desktop Firefox is smarter than you think. We have a tunable cache size which we won't download beyond until you free up space by playing cached data. It's 50MB by default. On mobile we'd obviously reduce that quite a bit.<br>
<br>I don't think your playlist example is compelling. DOM objects aren't good for building playlists or other data structures. On the other hand,<br>var shotSound = new Audio("shot.wav");<br>...<br>function shoot() {<br>
  shotSound.play();<br>  ...<br>}<br>should work reliably. For small sounds, leaving out 'autobuffer' may not be noticed on some browsers, since we have to download metadata and depending on network conditions we often get the whole file before we start to throttle the download for non-autobuffer elements.<br>
<br>Rob <br></div></div>-- <br>"He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all." [Isaiah 53:5-6]<br>