Skip to content
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

Fix: Sounds stop playing after context is interrupted (fixes #928) #1106

Merged
merged 1 commit into from
May 17, 2020

Conversation

alvov
Copy link
Contributor

@alvov alvov commented Dec 24, 2018

In Safari browser on iOS when browser tab loses focus the audio context gets interrupted. If during this inactivity the "_autoSuspend" timeout fires, Howler is set to the suspending state, but the self.ctx.suspend() promise gets rejected, so Howler is never switched to the suspended state (which would allow the _autoResume method to perform).

Steps to reproduce:

  1. grab iPhone with iOS 11 or 12
  2. start an application that uses Howler (autoSuspend property should be set to true)
  3. play a sound up to the end, which should trigger the auto suspension timer
  4. then switch from the browser to the home screen (or another app)
  5. wait for 30 seconds until the suspension timer fires, then switch back to the browser
  6. Howler is stuck in suspending state

@alvov
Copy link
Contributor Author

alvov commented Jan 7, 2019

@goldfire can you please take a look? it's a relatively small one 🙃

@alvov
Copy link
Contributor Author

alvov commented Apr 1, 2019

@goldfire I've added interrupted state handling as was discussed here #928 (comment)
please check this PR

@mmoss
Copy link

mmoss commented May 17, 2019

@goldfire any chance of getting this in?

@kurozael
Copy link

@goldfire is this being ignored? Because this is an issue for us in prod.

@kant2002
Copy link

@goldfire @kurozael any information when this will be merged in?

@abdurrahmancuce
Copy link

@goldfire why is this PR not merged? This is an issue for us in prod.

@kant2002
Copy link

kant2002 commented May 1, 2020

@abdurrahmancuce you can use @kant2002/howler package which I have to publish to start using code from this PR.

@goldfire goldfire merged commit 894b1e9 into goldfire:master May 17, 2020
@goldfire
Copy link
Owner

Sorry, I must have missed this one! Thanks for finding the solution to this. I've gotten it tested now and will have it released later today in 2.2.0.

@alvov
Copy link
Contributor Author

alvov commented May 18, 2020

@goldfire thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants