An open-source entry in TopGit's GitHub warehouse: lyswhut/react-native-track-player, 7 stars, Java. A fully fledged audio module created for music apps. Provides audio playback, external media controls, chromecast support, background mode and more!
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
📢 The Android side of RN track player is currently being rewritten with Kotlin and KotlinAudio. Help us test! More information here.
A fully-fledged audio module created for music apps. Provides audio playback, external media controls, background mode and more!
react-native-track-player is made possible by the generosity of the sponsors below, and many other individual backers. Sponsoring directly impacts the longevity of this project.
🥇 Gold sponsors ($2000+ total contributions):
🥈 Silver sponsors ($200+ per month):
🥉 Bronze sponsors ($500+ total contributions):
Become the first bronze sponsor!
✨ Contributing sponsors ($25+ per month):
⚠️ V2 Migration Guide
All queue methods have been updating to work on indexes instead of id's. We want this library to support all kinds of apps -- and moving to be index based will allow us to better support applications who have long/endless queues and in the future to allow us to build a performant API around queue management.
We recommend using Typescript to have the system alert you of issues.
When migrating from v1 to v2, the following has changed:
// Methods
- async function add(tracks: Track | Track[], insertBeforeId?: string): Promise<void> {
+ async function add(tracks: Track | Track[], insertBeforeIndex?: number): Promise<void> {
- async function remove(tracks: string | string[]): Promise<void> {
+ async function remove(tracks: number | number[]): Promise<void> {
- async function skip(trackId: string): Promise<void> {
+ function skip(trackIndex: number): Promise<void> {
- async function updateMetadataForTrack(trackId: string, metadata: TrackMetadataBase): Promise<void> {
+ async function updateMetadataForTrack(trackIndex: number, metadata: TrackMetadataBase): Promise<void> {
- async function getTrack(trackId: string): Promise<Track> {
+ async function getTrack(trackIndex: number): Promise<Track> {
- async function getCurrentTrack(): Promise<string> {
+ async function getCurrentTrack(): Promise<number> {
// Imports
import TrackPlayer, {
- STATE_XXX,
- CAPABILITY_XXX,
- PITCH_ALGORITHM_XXX,
- RATING_XXX,
+ State,
+ Capability,
+ PitchAlgorithm,
+ RatingType,
+ Event,
+ RepeatMode
} from 'react-native-track-player'
// Hooks
- useTrackPlayerProgress
+ useProgress
// Event Listeners
// Refrain from using: TrackPlayer.addEventListener() and instead use the provided hooks
+ usePlaybackState
+ useTrackPlayerEvents
+ useProgress
Features
Lightweight - Optimized to use the least amount of resources according to your needs
Feels native - As everything is built together, it follows the same design principles as real music apps do
Multi-platform - Supports Android, iOS and Windows
Media Controls support - Provides events for controlling the app from a Bluetooth device, the lock screen, a notification, a smartwatch or even a car
Local or network, files or streams - It doesn't matter where the media belongs, we've got you covered
Adaptive bitrate streaming support - Support for DASH, HLS or SmoothStreaming
Caching support - Cache media files to play them again without an internet connection
Background support - Keep playing audio even after the app is in background
Fully Customizable - Even the notification icons are customizable!
Supports React Hooks 🎣 - Includes React Hooks for common use-cases so you don't have to write them
Casting support - Use in combination with react-native-track-casting (WIP) to seamlessly switch to any Google Cast compatible device that supports custom media receivers
Quick Guides
Installation
Getting Started
Documentation
Platform Support
Background Mode
Build Preferences
Why another music module?
After trying to team up modules like react-native-sound, react-native-music-controls and react-native-google-cast, I've noticed, that their structure and the way should be tied together can cause a lot of problems (mainly on Android). Those can heavily affect the app stability and user experience.
All audio modules (like react-native-sound) don't play in a separated service on Android, which should only be used for simple audio tracks in the foreground (such as sound effects, voice messages, etc.)
react-native-music-controls is meant for apps using those audio modules, but it has a few problems: the audio isn't tied directly to the controls. It can be pretty useful for casting (such as Chromecast).
react-native-google-cast works pretty well and also supports custom receivers, but it has fewer player controls, it's harder to integrate and still uses the Cast SDK v2.
First Steps
If you want to get started with this module, check the Getting Started page.
If you want detailed information about the API, check the Documentation. You can also look at our example project here.
Example
A basic example of how to play a track:
import TrackPlayer from 'react-native-track-player';
const start = async () => {
// Set up the player
await TrackPlayer.setupPlayer();
// Add a track to the queue
await TrackPlayer.add({
id: 'trackId',
url: require('track.mp3'),
title: 'Track Title',
artist: 'Track Artist',
artwork: require('track.png')
});
// Start playing it
await TrackPlayer.play();
};
start();
Core Team ✨
David Chavez
Milen Pivchev
Special Thanks ✨
Guilherme Chaguri
Dustin Bahr
Community
You can find us as part of the React Native Folks Discord in the #react-native-track-player channel.
Yes — lyswhut/react-native-track-player ships under the Apache-2.0 license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/lyswhut/react-native-track-player.
What is lyswhut/react-native-track-player?
lyswhut/react-native-track-player (lyswhut/react-native-track-player) is a Java project on GitHub. From the project's own README: A fully fledged audio module created for music apps. Provides audio playback, external media controls, chromecast support, background mode and more!
What license does lyswhut/react-native-track-player use?
lyswhut/react-native-track-player is released under the Apache-2.0 license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where can I see lyswhut/react-native-track-player in action?
The project maintains a homepage at https://react-native-track-player.js.org/. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about lyswhut/react-native-track-player?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/lyswhut/react-native-track-player is the definitive source.
Read full README in the tab above.
Curious whether react-native-track-player is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about react-native-track-player.