11

When you stop your music which is playing in the music player, it doesn't really stop it. It just pauses it, as you are still able to see the music controls after you lock the screen. I want to remove the volume controls (rewind,play,forward) buttons which appear on the locked screen using the code behind. This has already been achieved by an existing app on the marketplace Stop the Music!. I have gone through this page, but still I am not able to understand how they are able to do so.

Is there anyway to achieve this??

gromiczek
  • 2,970
  • 5
  • 28
  • 49
Milan Aggarwal
  • 5,104
  • 3
  • 25
  • 54
  • 1
    it is possible. Please see the app Stop the Music, they have done it. I need to acheive the same effect for my app – Milan Aggarwal Aug 07 '12 at 10:18
  • 5
    I don't see why this was closed - it's not vague or overly broad. It is possible. Just change the MediaState to stopped and clear the queue. All Stop the music does, is clear the queue. – Michiel Jan 08 '13 at 14:12
  • 4
    Did @Mixx suggestion work? In that case, I'd say that Mixx should add an answer so you can accept the solution. :) – NoLifeKing Jul 24 '13 at 11:39

2 Answers2

1

Nice question, after some trial&error testing I've actually found out, how to remove the Music player from volume controls:

  • You need to add into your app empty file with .wma extension and set the build action as "Content", for instance "empty.wma" into the app root folder.
  • To stop the media playback and remove the media player just create dummy Song object and try to play it like this:

    Song s = Song.FromUri("empty", new Uri("empty.wma", UriKind.Relative));
    MediaPlayer.Play(s);
    

And that's all, because the file is invalid music file, nothing is playing and even the previous Music player has been removed.
Note I've tested this on Windows Phone 8 device with GDR3 update. Not sure, if it works as well on Windows Phone 7.5.

Martin Suchan
  • 10,600
  • 3
  • 36
  • 66
0

You don't need to do that now. Windows Phone 7.8 now have the music control as a popup when pressed volumn button on devices.

Tuan Tran
  • 73
  • 6