-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creates a pool of activated HTML5 Audio objects for use on mobile.
Currently the WebAudio API is unlocked via user interaction in the _enableMobileAudio method. This does not however unlock HTML5 Audio as well. Since HTML5 Audio objects must be individually unlocked, using them without user interaction can be accomplished by pooling a number of activated Audio objects at the same time WebAudio is unlocked, and using those pooled objects whenever a new sound is requested. Changes: - Adds a private mobile audio pool to the Howler object. - Adds a new Howler global configuration named "mobileHtml5AudioPoolDefaultSize" that governs the number of pooled Audio objects, with a starting value of 10. - Fill the pool in _enableMobileAudio(). - Use Audio objects from the pool when a Sound object is created in HTML5 mode. - An over-scheduled pool can be configured via the Howler.shouldMobileHtml5AudioPoolErrorWhenEmpty option to still return Audio objects, however they are not guaranteed to be unlocked. This option defaults to 'false'.
- Loading branch information
1 parent
8362b75
commit 4e5365b
Showing
1 changed file
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters