4 ms·
Can't we use serviceWorkers to workaround this? That's what they were created for. I have a webaudio side project that works nicely even on the background usin
by ogig 10y ago
Can't we use serviceWorkers to workaround this? That's what they were created for.
I have a webaudio side project that works nicely even on the background using serviceWorkers for timing. I'm hoping it will be the same on 56.
- Someone1234 10y agoNo. They aren't cross browser compatible or backwards compatible. They work fine in latest Chrome and kinda work in Firefox. But Edge and mobile browsers? Not a chance.
- judah 10y agoCan you elaborate? What does service workers give you for your web audio project that doesn't work without service works? I'm curious because I have a HTML5 audio web app that works great, except when running on mobile in the background.
- ogig 10y agoIn my project the serviceWorker only has a setInterval that will trigger the main loop. When the setInterval was in the main code it would slow down, a lot, when the tab was on background. That made the generated music go slow aswell. With the serviceWorker the clock is rock solid, even when the background app can't keep up, the timing is solid.
- Klathmon 10y agoIIRC service workers are shut off after something like 30 seconds of inactivity. So it may work for some cases, but not for all.
- timdorr 10y agoService Workers are specifically designed to be short-lived and temporary [1]. They should be tied to events coming from the main script, which is subject to these new timing limits in the background. You should check your app against Chrome 56, as you might be in for a surprise. [1]: https://www.w3.org/TR/service-workers/#service-worker-lifetime https://www.w3.org/TR/service-workers/#service-worker-lifeti...