locked
Background audio problem RRS feed

  • Question

  • Hi

    I'm creating audio player app. I use background audio player and I have a problem. Everythink works fine except one situation. My app plays mp3 from Internet. Before it starts to play it must prepare link. If I want to play first song after starting my app and I minimize app before media element gets the link, music starts to play but I can not hear the music. So, background music is audible only if I minimize the app after first song starts to play.

    When the app is minimized and one song from playlist ends and second starts to play everythink works great. 

    For this reason my app failed certification.

    Any ideas how to solve this problem?

    Friday, August 23, 2013 9:14 AM

Answers

  • I checked how it works in windows music app. When you minimize app too fast it sets source but does not start to play song. So when mediaElement.State isn't playing or paused I'm checking if app is minimized (Window.Current.VisibilityChanged helps a lot) and I'm setting mediaElement.AutoPlay to false. When app is active again i automatically start to play. 
    Friday, August 23, 2013 1:57 PM