I'm making a game in Silverlight, and I'd like to give it some background music. And in particular I'd like to avoid including the MP3 in the initial download (the XAP) - so that the user can start playing before the music has finished downloading.
How do I:
- Dynamically start playing an MP3 file from a given URL
- Have the MP3 file start playing before it has finished downloading
- Start downloading the MP3 file without having it play (ie: preload it)
- In such a way that the MP3 file is cached if the user returns to the page later
(I am assuming all of these things are possible?)
I am not really using XAML, by the way - so a code-based answer is appreciated.