Thought for the Dazed

I've had to give up that Distance Learning course as I was having trouble seeing the teacher.

Flickr
www.flickr.com
RobMiles' items Go to RobMiles' photostream
Twitter
C# Yellow Book

Search entire site
« Mr Squeek’s Roller Coaster Ride | Main | Skydrive from Windows Phone Apps »
Tuesday
Dec132011

Media Player and Marketplace Certification with Windows Phone

London Building

One of our students was having problems with Marketplace Certification for his XNA game. The game was failing certification because his game background music was playing over the top of any media that the phone user was listening to. There is a simple way to fix this, which is not to play your game music if the user is listening to something. You can do this by testing to see if the media player is stopped before playing your music:

if (MediaPlayer.State == MediaState.Stopped)
{
    // play your own music here
}

The MediaPlayer class lives in the System.XNA.Media namespace. If you are writing a Silverlight game you’ll have to import the XNA libraries.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.