webGL audio stopped after minimizing/restoring on mobile

I understand that webGL is not officially supported on mobile devices.

When we run our Unity webGL app in Safari/Chrome/etc on an iPad, it works fine until you switch to another app and then come back. Most of the time, from that point on there is no audio. Sometimes there is audio. Very random. Reloading the web page fixes it.

I am assuming that the audio is being paused, but for whatever reason sometimes it does not get resumed.

Does anyone know how to fix this?

I was able to figure out a solution using the javascript and C# script that Alex posted here :

In the OnVisibilityChange() function I check if it is visible and call the sound manager I am using to “ResumeAll()”.