Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove volume controls on lock screen in WP7?

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??

like image 565
Milan Aggarwal Avatar asked May 07 '12 04:05

Milan Aggarwal


People also ask

How to fix volume control stuck on screen Windows 10?

[Partition Magic] 1 Method 1: Update or Reinstall Your Sound Driver. As mentioned before, the volume control stuck on the screen issue might be caused by the conflict with the sound driver. 2 Method 2: Run Windows Troubleshooter. ... 3 Method 3: Change the Notification Time. ... 4 Method 4: Clean Boot Your Computer. ...

How do I remove the volume control from the taskbar?

Press Windows key on your keyboard or click Start. On the Cortana search box, type Taskbar Settings and click the result. Under Notification area, click Select which icons appear on the taskbar. Turn Off the toggle for Volume. Verify that the volume is removed from the taskbar. Let us know if you were able to hide the volume control.

How do I hide the volume display on the screen?

The volume display on the screen lets you adjust the volume easily and check the actual volume level. If you wouldn't want to see it on the screen or on the task bar, you can hide it by performing these steps: Right-click on the task bar. Select Settings. Under Notification area, click Turn system icons on or off.

How do I adjust the volume on my computer?

When you are trying to adjusting the volume on your computer, a volume control bar will appear on the top left corner of the screen. Normally, the volume bar will disappear automatically a few seconds after you complete the adjustment.


1 Answers

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.

like image 194
Martin Suchan Avatar answered Nov 10 '22 09:11

Martin Suchan