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: audio cannot play after unplugging headphones on IOS #1551

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiaobao66
Copy link

@xiaobao66 xiaobao66 commented Jan 20, 2022

Fixes #1355
On iOS, when you unplug headphones, its policy will suspend any AudioContext and Howler.ctx.state is changed to 'suspended'.
But In the _autoResume function, AudioContext can only be resumed when Howler state is 'suspended' or Howler state is 'running' and Howler.ctx.state is 'interrupted':

} else if (self.state === 'suspended' || self.state === 'running' && self.ctx.state === 'interrupted') {

Originally posted in #1355 (comment)

@paulfernandes
Copy link

paulfernandes commented Feb 15, 2022

@goldfire, is there any plan to merge this into master any time soon? This would be useful to solve a currently known issue.

@profispojka
Copy link

@goldfire, is there any plan to merge this into master any time soon? This would be useful to solve a currently known issue.

Hi. I had forked this lib and merged a few urgent PRs. If you want, make a pr to https://github.com/profispojka/loudest and you will soon find the changes in https://www.npmjs.com/package/loudest

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.

Howler state is still 'running' while AudioContext state is 'suspended'
3 participants