-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add touchstart to enable mobile audio when swiping too #808
Conversation
On iOS, if you swipe, for some reason `touchend` doesn't get triggered. We have a game where you needed to swipe and sound was only enabled when you actually tapped. Using `touchstart` seems to fix it. I think it is safe to keep two listeners.
Thanks! Going to try and get 2.0.5 out today, wanting to get a few more issues fixed in it. |
I seem to remember that i was ios 9 that broke all this originally. Everyone used touch start, ios 9 came out and required touchend instead. Clearly touchstart works again now, but is that a short term fix? I seem to remember one of the developers for safari saying it made sense to only unlock on touch end because otherwise, and thinking in terms of horrible adds wanting to play sound, you'd pick up scrolling down a webpage on touchstart when actually a tap with touchend is closer to the meaning of the interaction the developers wanted |
Hmm, that is a good point. Do you know if something like |
Also, I just did some more testing and the |
mouse wise, anything other than 'click' i've had issues with at one stage or another. The touchend event thing... I'm not sure, actually. Not at work to get the devices out to test. What I did was make my opening screen require a successful touchend, just like Howler does. Then, if they tried to swipe, well, they're not getting in until they follow the clear instruction to tap! |
Okay, so I put together this fiddle and tested on an iPhone and the https://jsfiddle.net/5Leq0ak3/ I'm going to pull this out for now and get 2.0.5 released, but will put it back in once we've nailed down the correct behavior (sorry about the premature merge). |
Ok, but did you test it with sound and did it enable? |
@markknol Good point! I just modified the fiddle to try unlocking the audio and while the |
Thanks! This was exactly my experience too 👍 |
This is in reference to goldfire#808
Add touchstart to enable mobile audio when swiping too
This is in reference to goldfire#808
On iOS, if you swipe, for some reason
touchend
doesn't get triggered. We're building a WebGL game where you needed to perform a swipe movement and sound was only enabled when you actually tapped. Usingtouchstart
seems to fix it. I think it is safe to keep two listeners.When is the next release planned?