Reputation: 2630
I am going for a most simplistic playback of background audio. I don't even want to capture media controls or anything. I just want to start the app and play audio until I explicitly close it. That is, it should play audio while hidden.
I used this article and this question as reference and I followed their guidance:
<MediaElement Name="someMedia"
AudioCategory="BackgroundCapableMedia"
IsLooping="True"
Source="Assets/some.mp3"
AutoPlay="true"/>
Also, I added Background Tasks
to my Package.appxmanifest
's Declarations
, checked Audio
and set the start page. What am I missing?
Upvotes: 0
Views: 289
Reputation: 11228
You should also enable SystemMediaTransportControls
and handle two events on it and on your MediaElement
to keep them in sync.
Check this article: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj841209.aspx
Upvotes: 1