-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[iOS][Audio] Can't play an audio when the app is already in background #5472
Comments
Hello @gsantiago , I also faced the same issue that you mentioned. The only workaround I found is to keep the screen awake pro-grammatically, however as soon as user locks the screen, next audio doesn't start. Did you find any workaround? |
@vikash-gupta I have disabled the background audio in iOS for now. |
Bumping this up... Can anyone please look into it? |
Would love to see this resolved. |
+1 |
1 similar comment
+1 |
My entire App is about sounds which start when the app is in Background, so it would be wonderful if this feature worked ! |
My app is a music player... Now you can only play one song in the background. Looking forward updates |
Is any progress on this issue? |
same issue encountered |
My steps to reproduce:
and for app.json:
|
same issue |
+1, any idea @ide ? |
+1 same issue. Any updates on this?? |
This is a huge issue |
Any other known audio players that can handle this functionality in React Native? |
@sjchmiela @cruzach any thoughts here? |
from our managed workflow limitations docs page you may need to eject if you want more complete background audio functionality, for now |
@brentvatne Wondering if there's a plan to work on this in the near future? |
i wish we had time to but are pretty busy at the moment with bigger infrastructure improvements because that work will unblock users from solving issues like this for themselves. if anyone here would like to hire someone to work on this feature for you, i would recommend reaching out to https://swmansion.com/ - we are partners with them and they have a lot of experience at the org with expo and react-native. i would highly recommend them |
@brentvatne Thank you for the response. Hope to see that update soon! |
Expo should implement an audio playback service in the native expo runtime, eg run not on react native thread which handles playback in bakgrund per default which is communicated over bridge instead of running audio on the ui layer (as now with expo av) |
As far as I'm aware, this was due to an issue in expo-av (similar issue was reported here #9363) You should now be able to resume/play audio when in the background when This has not yet landed in the Expo client, but you can try it out in a bare project using:
You can find the changelog here: https://github.com/expo/expo/blob/master/packages/expo-av/CHANGELOG.md Let us know whether that fixes it for you. |
Same issue |
same issue. What's the status of this? 👀 |
This closed issue is two years old and new issues with similar symptoms may have different root causes. The best way to help address a problem is to suss out the cause and write it up in a new issue. |
With above config my application works fine reproducing on background on iOS simulator: Audio.setAudioModeAsync({
allowsRecordingIOS: false,
staysActiveInBackground: true,
playsInSilentModeIOS: true,
}) "ios": {
"infoPlist": {
"UIBackgroundModes": [
"audio"
]
}
} |
Im facing a simular problem with "expo-av": "^13.2.1". I try to record audio with my app. When interruption by locking the screen the recording stops. The recording time is still going and after unlocking the screen the recording continues. UIBackgroundModes: ["audio"]
|
For those who the background audio works in the background, you may want to check if UIBackgroundModes in both the app.json and Info.plist file. I believe once you have a bare app (you have an |
🐛 Bug Report
Environment
This bug only happens in iOS.
Steps to Reproduce
Expected Behavior
Actual Behavior
Reproducible Demo
https://snack.expo.io/@gsantiago/reproducible-bug---failed-to-play-audio-when-the-app-is-in-background
And, yes. I have set
staysActiveInBackground: true
and all other necessary modes to play in background, and also UBackgroundModes: ['audio'] in the app.json.The text was updated successfully, but these errors were encountered: