About this project
react-native-track-player is an audio playback library for React Native applications. According to its README, it is built on the New Architecture using JSI and TurboModules, aiming to avoid bridge overhead and jitter.
Key capabilities described in the README:
- Simple TypeScript API with full typing for React Native developers
- New Architecture native implementation via JSI with TurboModule support
- Background playback, so audio continues when the app is backgrounded or the screen is off
- Android Auto support for native car dashboard integration
- Preloading, described as background buffering of upcoming tracks for gapless-like playback
- Built-in audio caching to reduce bandwidth and enable offline playback
- Remote controls including lock screen, notification controls and headset support
- React hooks such as usePlaybackState, useIsPlaying, useProgress and useActiveMediaItem
Requirements: React Native 0.74 or later, with the New Architecture enabled (Fabric + TurboModules). Installation is via npm install @rntp/player, followed by pod install for iOS; Android links automatically.
The README shows a quick-start flow: call TrackPlayer.setupPlayer once at app startup (in the foreground on Android) with options such as contentType, handleAudioBecomingNoisy and android.wakeMode; add media items with url, title, artist and artwork; call TrackPlayer.play(); and consume hooks in the UI.
V5 is described as a complete rewrite that is not backwards-compatible with V4. Stated V5 improvements include synchronous returns from getProgress(), getQueue() and isPlaying(), full TurboModule and Fabric support, and rewritten Android and iOS native layers.
Licensing is an important consideration: starting with V5 the project is commercially licensed. Personal and educational use remains free, while commercial use requires a paid license. V4 and earlier remain available under Apache-2.0 on the v4 branch. Full documentation and API reference are hosted at rntp.dev.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.