goldfire / howler.js

Javascript audio library for the modern web.
https://howlerjs.com
MIT License
23.29k stars 2.21k forks source link

Howler sounds dont play if browser tab is minimized in howl - 'loading' state #1682

Open bundely opened 9 months ago

bundely commented 9 months ago

The Problem

So I got a bug reported from QA for my game when its about to load and if we either change tab or minimize the game right at a point when loaded sound data URL is assigned to Howler to create howls and when its in its 'loading' state. The sounds never get loaded when browser tab is back to game. The sounds get stalled forever. I know this is one edge case happens for a moment but if there is any workaround for this then please let me know.

Reproducible Example

No response

Reproduction Steps

Load any Howler based application. Just when the howls are in loading state change the browser tab or minimize the browser. When game is maximized the howls never resume loading and never get to loaded state.

Possible Solution

Can this loading and loaded state of howls be handled through web workers on howler side?

Context

Bug on my game.

Howler.js Version

v2.2.3

Affected Browser(s)/Versiuon(s)

latest chrome