Closed JenGL closed 5 years ago
It seems to be working for me. Can you provide a sample and specify a mobile platform/browser?
https://jsfiddle.net/vsm3rhr2/1/
as you can see after the tap on the box the first audio is reproduced but not the second. It requires another tap ! The problem may be that for every html5 sound you create obvious a new Audio(); object that can't be unlocked with a previous tap
I haven't been able to find a workaround for this so far. The issue is being tracked within Chromium here: https://bugs.chromium.org/p/chromium/issues/detail?id=178297. If anyone can find a workaround I'll be happy to include it.
I have no time to implement this now, but you should create more audio element in the initialization of the lib and on the first touchevent unlock these element all together. Create an audioPoll where you can ask for an audio element that is free and use that poll instead of creating new Audio allover the code. The audio element will be inserted in the poll on the end of the reproduction.
This is working for me (I'm implementing this directly with audio tag without Howler atm)
I tryed a draft implementation of what i was tryng to explain in the last comment: this is the code: (based on 2.0.0-beta12) http://pastebin.com/BTku1RUp
This should now be fixed in v2.1.0 using the HTML5 Audio pool.
If you use html5: true in howler 2.0 the auto-unlock audio with user gesture doesn't work.