1

I created a media player app using UWP for Windows 10. Currently I cannot play any audio in the background, when I minimize my media player window the audio stops playing and resumes when I maximize the window. This is my media element XAML code I used:

<MediaElement x:Name="PlayerElement" Height="532" Width="829" 
                            AreTransportControlsEnabled="True" Stretch="Uniform" HorizontalAlignment="Center" 
                            VerticalAlignment="Center" PosterSource="/Images/Logo3.png" 
                          AutoPlay="True" MediaEnded="PlayNewSong" Margin="0,0,-9,0" AudioCategory="BackgroundCapableMedia"/>

I thought the AudioCategory property would solve my problem, but unfortunately it doesn't. Any help would be appreciated.

artista_14
  • 674
  • 8
  • 22

1 Answers1

2

Check this official sample collection from microsoft WindowsUniversalSamples

You can pull BackgroundMediaPlayback folder for sample project you need.

artista_14
  • 674
  • 8
  • 22
  • artista_14 is correct. There is the samples link provided above and the tutorial here: https://learn.microsoft.com/en-us/windows/uwp/audio-video-camera/background-audio – chcortes Sep 26 '17 at 18:36