thangngoc89/react-howler

Using with react-router v4: sound is not played without explicit refresh

PEZO19 opened this issue · 3 comments

I have a weird bug and I have not idea how is it possible.

I am creating a game and I use react-howler for it. Until this point I haven't used parameters in my route, but I do now, and when I do it seems the .mp3 assets do not load properly.

The scenario is this:

  1. I visit to /app_eng (the route without parameter),
  2. I click the PLAY button which drives me to /game on client.
  3. I start clicking on elements, and the proper actions with proper meta properties fire off
  4. I hear the sounds.

But if I use the route as a parameter (matching /app/:lang)

  1. I visit to /app/eng (I know it works, because I can read "eng" from the "lang" property),
  2. I click the PLAY button which drives me to /game on client.
  3. I start clicking on elements, and the proper actions with proper meta properties fire off
  4. I do not hear the sounds.
  5. I refresh the page on /game
  6. I start clicking on elements AGAIN, and the proper actions with proper meta properties fire off
  7. I hear the sounds.

What might cause this behaviour?

If you can make a reproducible test case, I would be appreciated. Otherwise, this is just insane to debug.

Okay, if I don't get any solution on other forums I will create it.

Sorry it turned out it is not related to react-howler.