Jump to content
Search Community

howler.js sound is delayed on mobile(ios) on Timeline.

Rio test
Moderator Tag

Recommended Posts

Hi gsap community,

 

This is my first post!  I'm sorry if this is already asked previously.

I am trying to synchronize sound effect and the animation via howler.js .

 

The issue is that the sound does not start on the first attempt of play(). This is happening only on mobile(ios).

There is no problem when I tap on restart(second attempt). Desktop works like a charm.

 

Why this on mobile?

See the Pen 8ba9316d6abf27c301f65e9de0ffc5c5 by riotron (@riotron) on CodePen

Link to comment
Share on other sites

Hey Rio and welcome to the GreenSock forums! Thanks for supporting GreenSock by being a Club GreenSock member.

 

Unfortunately this is something wrong with howler so we can't be of much help. If you put an alert in the click callback you can see that it's being called when it should, howler is just delaying the play for some reason. I'd ask about it on their GitHub repo.

 

FYI there's a bug on desktop if you click restart() before the animation finishes playing.

 

Let us know if we can help with anything else!

  • Like 1
Link to comment
Share on other sites

Hi Zack,

 

Thanks a lot!  I appreciate you posted the howler GitHub repo. That would be a big help to me.

BTW, I fixed the bug related to restart() . Thanks as well.

 

I would post something here when I found the solution.

 

Rio

Link to comment
Share on other sites

I have updated my codepen above posted so that I can synchronize the sound and animation as I intended.  I just inserted silent sound in the timeline and the main sound starts off after the offset(3 seconds). If anyone has a better idea, I am grateful with that. Thanks.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...