Click here to Skip to main content
15,902,276 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Windows Phone application that does this, using this simple method in my App.xaml.cs file:

C#
public void BackgroundMusic()
{
    if ((bool)settings["music"])
    {
        if ((MediaPlayer.GameHasControl) && (MediaPlayer.State != MediaState.Playing))
        {
            Song s = Song.FromUri("BackgroundMusic", new Uri("audio/background.mp3", UriKind.Relative));
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Play(s);
        }
    }
}


This approach does not seem to work in Windows 8. Has anyone identified a simple solution to this problem?
Posted
Comments
Sergey Alexandrovich Kryukov 11-Feb-13 23:29pm    
What this "across multiple pages" is supposed to mean, exactly?
—SA

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900