Can't MediaPlayer.Stop User's Music to Play Game Music #2075

Closed
dancolasanti opened this Issue Oct 11, 2013 · 8 comments

5 participants

@dancolasanti

On WP8 there is a requirement that if the user is currently playing Music when a game is started, the game must ask the user if it's OK to stop their music in order for the game to play its own music (for example, a background music track played by the MediaPlayer).

Unfortunately, the same code used in XNA on WP7/WP8 to stop the user's music isn't working in MonoGame - it has no effect. The MediaPlayer.State == Stopped when the game starts up, even if the user is currently playing music, so calling MediaPlayer.Stop() does nothing - and the user's music continues playing.

@MoreKoo

Same problem here.... MediaPlayer.Stop() has no effect in stopping player's own background music.

@dancolasanti

@MoreKoo my comment was about MonoGame 3.1, but recently 3.2 was released (and I haven't checked it yet). Are you using MonoGame 3.1 or 3.2?

@MoreKoo

We are using 3.2.

@aberus

I have solution for this. I'll submit fix today.

@MoreKoo

Excellent, @aberus!

@dancolasanti

@aberus Did you submit this fix? I can't find it... please send a link to it. Thanks!

@tomspilman
MonoGame member

@Nezz - Did you deal with this in your game?

@Nezz
MonoGame member

Here's a fix :)

@Nezz Nezz referenced this issue Aug 24, 2014
Merged

Fixed #2075 #2946

@tomspilman tomspilman pushed a commit that closed this issue Sep 10, 2014
@Nezz Nezz Fixed #2075
Cleaned up the usage of playingInternal to be WP only
67783a1
@zyphrus zyphrus pushed a commit that referenced this issue Oct 18, 2014
@Nezz Nezz Fixed #2075
Cleaned up the usage of playingInternal to be WP only
7bcf4cc
@zyphrus zyphrus pushed a commit that referenced this issue Oct 18, 2014
@Nezz Nezz Fixed #2075
Cleaned up the usage of playingInternal to be WP only
b7baeee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment