Overview:
The react-native-music-control package was designed to display and manage media controls on the lock screen and notification center for both iOS and Android platforms. Please note that this package is no longer maintained and users are recommended to switch to react-native-track-player for ongoing support and updates.
Features:
- Media Controls Management: Display media controls on the lock screen and notification center.
- Now Playing Functionality: Enable music controls with the setNowPlaying method and disable them with resetNowPlaying.
- Customizable Controls: Ability to enable/disable controls on iOS lockscreen and Android notification center, including skipBackward and skipForward with interval customization.
Installation:
To install the react-native-music-control package, you can follow these steps:
Install the package using Yarn or NPM:
yarn add react-native-music-controlor
npm install react-native-music-controlFor iOS:
- Run
pod install --project-directory=ios/in the project directory. - Enable Audio Background mode in Xcode project settings.
- Run
For Android:
- Add the
android.permission.FOREGROUND_SERVICEpermission toAndroidManifest.xml. - Set the
launchModeofMainActivitytosingleTaskinAndroidManifest.xml.
- Add the
For more detailed installation instructions based on the React Native version and troubleshooting tips, refer to the provided documentation.
Summary:
The react-native-music-control package offers a convenient solution for managing media controls on iOS and Android devices, allowing developers to enhance the user experience by providing playback control options on various screens. While no longer actively maintained, users can migrate to the react-native-track-player library for continued support and compatibility with the latest platform updates.