Home Enabling background audio in my Windows Store HTML5 app
Reply: 0

Enabling background audio in my Windows Store HTML5 app

user1318 Published in July 22, 2018, 10:27 am

I have an HTML5 Progressive Web App (PWA) that I've packaged into the Window Store thanks to PWABuilder. It's a Pandora-like music app that plays audio via the HTML5 audio tag.

The app works fine on Windows 10 until I minimize the app, then the audio stops playing. I want my app to keep playing audio even when minimized.

My first thought is I need to declare the appropriate capabilities in my app manifest. So, in my appxmanifest.xml, I added:

   <uap3:Capability Name="backgroundMediaPlayback" />

But even with the backgroundMediaPlayback capability, it doesn't work; minimizing the app stops the audio.

Looking at the Universal Windows audio sample app, it says this should work:

"Adding the backgroundMediaPlayback capability enables all media playback APIs become background enabled. That means you can use any platform audio APIs, such as MediaPlayer, AudioGraph, XAudio2, and the HTML Audio tag."

If I'm reading that right, it means simply adding the backgroundMediaPlayback capability should make my HTML5 audio tags work in the background. Is there something else I'm missing?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306497 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO