Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Cacheaudio [SC2]

Does cacheaudio actually download the audio ready to play or does it just "create a place" for them? I'm aware that a lot of people have a fixed data plan on their phones, and some people even still have a fixed amount of downloads for their landline plan, and at the moment I've got several music tracks and the last thing I want is someone blowing or hammering their data plan and then running out/getting a massive bill.

Assuming it does, can I do something like:
<<if $ismobile = 0>>
Cache audio stuff
<<else>>
<<endif>>
after I ask whether the player is on a fixed data plan?

At the moment I've also got a few YouTube tracks I'm using and I'm using that for whether a soundtrack plays or not, but there are a few tracks that I'm using that aren't available on YouTube (they are Creative Commons) which are on my server and need to be cached if used.

Thanks in advance.

Comments

  • The <<cacheaudio>> macro creates an object for the audio track and informs the browser that it will need the audio resource at some point in the future—specifically, it asks that the resource be loaded as soon as the browser deems convenient. It does not attempt to force the track to be loaded immediately, though the browser may do so if it decides that's the best course of action.

    TL;DR: You shouldn't need to worry about it. When the audio track is actually loaded from the network is up to the browser itself. AFAIK, mobile browsers are unlikely to load such audio tracks until they're actually needed—meaning, when the player does something which initiates playback.
Sign In or Register to comment.