# Unity WebGL minimization causes sound to disappear

**URL:** https://qa.fmod.com/t/unity-webgl-minimization-causes-sound-to-disappear/23369
**Category:** Unity
**Tags:** ios, html5, unity
**Created:** [September 17, 2025, 9:36am UTC](https://qa.fmod.com/t/unity-webgl-minimization-causes-sound-to-disappear/23369 "2025-09-17T09:36:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tony020409](https://avatars.discourse-cdn.com/v4/letter/t/5f8ce5/32.png) [@tony020409](https://qa.fmod.com/u/tony020409)
#### Post date: [September 17, 2025, 9:36am UTC](https://qa.fmod.com/t/unity-webgl-minimization-causes-sound-to-disappear/23369/1 "2025-09-17T09:36:40Z")

</div>

I am currently encountering a similar issue as in this post,  
but my platform is Unity WebGL.  
[https://qa.fmod.com/t/fmod-unity-ios-no-sound-after-app-resume-or-ad-even-after-upgrading-to-2-02-28/22836](https://qa.fmod.com/t/fmod-unity-ios-no-sound-after-app-resume-or-ad-even-after-upgrading-to-2-02-28/22836)  
My WebGL is embedded in an iOS app.  
The problem is that after minimizing the app window and returning,  
the sound disappears. However, there are two situations where the sound recovers:

1. I trigger the iOS side to play an ad via JSLib, and the sound recovers after returning.

2. Repeatedly minimizing and returning has a low probability of recovering the sound effects.

I trigger the focus using a JSLib web method,  
because Unity’s OnApplicationFocus often doesn’t work.  
I have configured the buffer size with System::setDSPBufferSize(1024, 4),  
and also tried 4096, but it still doesn’t solve this problem.  
Is there any progress on this issue? Thank you 🙂

**unity C#**

```c
public void OnFocusGained()
{
     Debug.Log("Focus Gained");
     FMODUnity.RuntimeManager.CoreSystem.mixerResume();
     FMODUnity.RuntimeManager.CoreSystem.update();
}

public void OnFocusLost()
{
     Debug.Log("Focus Lost");
     FMODUnity.RuntimeManager.CoreSystem.mixerSuspend();
     FMODUnity.RuntimeManager.CoreSystem.update();
}

```

**Focus.jslib**

```java
mergeInto(LibraryManager.library, {
    InitFocusListener_j: function() {
        try {
            document.addEventListener('visibilitychange', function() {
                if (!document.hidden) {
                    SendMessage('unitygameobject', 'OnFocusGained');
                } else {
                    SendMessage('unitygameobject', 'OnFocusLost');
                }
            });
            console.log("Visibility listener initialized");
        } catch (error) {
            console.error("Failed to initialize visibility listener: " + error);
        }
    }
});

```

The method to trigger ads is that I use JSLib to call the iOS native side.  
The iOS side then calls the ad through the AdMob plugin,  
which overlays a window on top of my WebGL.  
The overlay window closes only after the ad ends.

Unity2021.3.8f1  
Fmod 2.03.09  
Iphone SE2  
IOS 26  
WebKit  
OpenGL ES 3.0(WebGL 2.0)

---

<div class="post-metadata">

### Author: ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)
#### Post date: [September 23, 2025, 1:06am UTC](https://qa.fmod.com/t/unity-webgl-minimization-causes-sound-to-disappear/23369/2 "2025-09-23T01:06:41Z")

</div>

Hi,

Thank you for sharing the detailed information and repro steps.

We are still investigating this issue and unfortunately don’t have significant progress to report yet. From our side we have mainly observed that the behavior seems to differ between browsers and WebView implementations, which makes it less consistent on iOS compared to other platforms.

In the meantime, could you please share how you configure and manage **AVAudioSession** on the iOS side? Also, if you haven’t already, please review [Handling Interruptions](https://fmod.com/docs/2.03/api/platforms-ios.html#handling-interruptions) in our docs.

Those details might help us determine whether session category or lifecycle is contributing to audio loss on resume.

Thanks again for your patience while we continue looking into this.

---

<div class="post-metadata">

### Author: ![Sebi99](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@Sebi99](https://qa.fmod.com/u/Sebi99)
#### Post date: [April 12, 2026, 10:32pm UTC](https://qa.fmod.com/t/unity-webgl-minimization-causes-sound-to-disappear/23369/3 "2026-04-12T22:32:31Z")

</div>

Hello,  
I am experiencing a similar issue.  
Any solution to this?

---

<div class="post-metadata">

### Author: ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)
#### Post date: [April 14, 2026, 5:48am UTC](https://qa.fmod.com/t/unity-webgl-minimization-causes-sound-to-disappear/23369/4 "2026-04-14T05:48:28Z")

</div>

Hi,

Thanks for checking in.

I don’t have any new updates on this one at the moment, unfortunately.

We do have a task on our backlog to improve the code for initializing the iOS AVAudioSession settings, and I’ll make sure to add your interest to it.
