1
votes

My test app tries to play Audio when minimising app, so I selected "Background Media Playback". But when the mouse moves to App Icon on WindowsTaskBar, button Next/Prev/Pause displayed (see in below Image). How to remove them?

Error image, Don't enough reputation for post image Error image, Don't enough reputation for post image

1

1 Answers

1
votes

You can disable them from the Background task using the IsEnabled property of the SystemMediaTransportControls class.

var controls = BackgroundMediaPlayer.Current.SystemMediaTransportControls;
controls.IsEnabled = false;

Similarly, you can disable them when the app is in the foreground using:

var controls = SystemMediaTransportControls.GetForCurrentView();
controls.IsEnabled = false;