React Native Music Control screenshot

React Native Music Control

Author Avatar Theme by Tanguyantoine
Updated: 6 Oct 2022
697 Stars

Display and manage media controls on lock screen and notification center for iOS and Android.

Categories

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:

  1. Install the package using Yarn or NPM:

    yarn add react-native-music-control
    

    or

    npm install react-native-music-control
    
  2. For iOS:

    • Run pod install --project-directory=ios/ in the project directory.
    • Enable Audio Background mode in Xcode project settings.
  3. For Android:

    • Add the android.permission.FOREGROUND_SERVICE permission to AndroidManifest.xml.
    • Set the launchMode of MainActivity to singleTask in AndroidManifest.xml.

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.