react-native-music-control
complete
Ladislav Soukup
This will allow expo app to display Now playing Info on lockscreen / control center widget and handle control events.
This will extend the Audio background playback support.
Axel Delafosse
Hi everyone!
You can now use React Native Music Control with Expo.
Start by creating a custom development client for your Expo app and then install React Native Music Control.
Here is the configuration required for audio playback in background:
iOS: Enable audio playback in background via your app.json https://docs.expo.dev/versions/latest/sdk/audio/#playing-or-recording-audio-in-background-ios
Android: All good! Expo already includes the required settings.
Enjoy :)
Jøran Bjerksetmyr
Worth noting that this is not supported anymore. expo-av have never supported it out of the box and react-native-music-control is no longer maintained. The only alternative is react-native-track-player (instead of using expo-av), but the Expo support is very unstable unfortunately. Feel like this is the only big feature missing from the expo-av library. The ability to control playback from the control center/lock screen.
Gionata Brunel
hi there - perhaps do you have a working example for managed workflow? I'm not sure how to proceed and your help woud be highly appreciated.
Fatih KÖSE
Android crashes automatically.
As far as I checked FOREGROUND_SERVICE is due to authorization
Eduard Duluman
Fatih KÖSE: Yes, I'm also hitting the same issue on Android. How do we give access to "FOREGROUND_SERVICE" as I cannot see it in the app.json docs reference for Expo...
Wodin
Eduard Duluman: Try adding literally
"FOREGROUND_SERVICE"
to the permissions
under android
in app.json
. If that doesn't work, try "android.permission.FOREGROUND_SERVICE"
instead.Eduard Duluman
Wodin: Yeah, I did just that. The reason I asked was because in the expo docs, under app.json permissions that you can use, there was no mention of this. And its formulated in such a way that nakes you think those are the only you can use.
“You can specify the following permissions”, which made me think these are the only supported.
Regards
Axel Delafosse
complete
Axel Delafosse
Hi everyone!
You can now use React Native Music Control with Expo.
Start by creating a custom development client for your Expo app and then install React Native Music Control.
Here is the configuration required for audio playback in background:
iOS: Enable audio playback in background via your app.json https://docs.expo.dev/versions/latest/sdk/audio/#playing-or-recording-audio-in-background-ios
Android: All good! Expo already includes the required settings.
Enjoy :)
Given Nyauyanga
Axel Delafosse: I have tried adding a custom plugin into my app and can't get expo app.js to recognise my custom plugin. Can you please help with some example of how you achieved it?
Wodin
Given Nyauyanga: I suggest you post a message to forums.expo.dev to explain what you're trying to do, what you have tried so far and what is not working.
Jesse Mezini
Given Nyauyanga: I followed react-native-music-controls instructions and added FOREGROUND_SERVICE to android/app/src/main/AndroidManifest.xml then "expo prebuild" and then "eas build --profile development --platform android". I didn't added custom plugin, I don't know if this is the right way, but everything is working
Wodin
Jesse Mezini: That is definitely one way to do it, but that is the Bare workflow. If you write a config plugin to do it (or ask the authors of the
react-native-music-controls
library to write one) then you can still use the Managed workflow.Eduard Duluman
Wodin: How does one go about adding FOREGROUND_SERVICE within the Managed wofkflow ?
Juan Pablo González
This could be a game changer in terms of system wide integration when using expo audio in a project!
G
Green
Is this the feature that lets you control the player from in LockScreen? If so please please please implement it. Thanks.
Ruth Akintunde
Hello expo. Please let's achieve this! Thank you.
Venkata Sunil Kumar Anumolu
Is it added in expo SDK 38?
If not any idea in what version this feature will be available.
This feature is really important for me as I am building a music app which really needs this sort if feature (music controls on lockscreen and notification)
Ladislav Soukup
Venkata Sunil Kumar Anumolu: no, it is still "planned" as part of - https://expo.canny.io/feature-requests/p/audio-playback-in-background
Don S.
Please integrate with
react-native-track-player
(the bluetooth speaker playback control too) Thank you.David Goldstein
Don S.: bump
Paolo Santarsiero
Don S.: i try to integrate it but it gives to me a error as STATE_NONE when i try only to import it in a functional component. Are you sure that Expo supports it?
Marc Pope
Paolo Santarsiero: they do not.
Axel Delafosse
Don S.: You can now use
react-native-track-player
! Cf. the pinned comment here: https://expo.canny.io/feature-requests/p/audio-playback-in-backgroundLoad More
→