ランキングに戻る

doublesymmetry/react-native-track-player

TypeScriptrntp.dev

The best audio player for React Native. Built on the New Architecture — Android Auto, caching, preloading, background playback, and more.

react-nativemusic-playermusic-librarymedia-controlandroidioswindowsaudioaudio-libraryaudio-player
スター成長
スター
3.7k
フォーク
1.2k
週間成長
Issue
8
1k2k3k
2017年3月2020年4月2023年6月2026年7月
成果物npmnpm install react-native-track-player
README

react-native-track-player

The premium audio player for React Native.

Built on the New Architecture with synchronous native calls — background playback, Android Auto, audio caching, preloading, and more.

[!IMPORTANT] Starting with V5, react-native-track-player is commercially licensed. Personal and educational use remains free; commercial use requires a paid license — see rntp.dev/pricing. V4 and earlier remain available under Apache-2.0 on the v4 branch.

npm version npm downloads License


Features

  • Simple TypeScript API — Clean, minimal API fully typed for React Native developers
  • New Architecture Native — Built on JSI with TurboModule support, no bridge overhead, no jitter
  • Background Playback — Audio continues when the app is backgrounded or screen is off
  • Android Auto — Full support for native car dashboard integration
  • Preloading — Background buffering of upcoming tracks for gapless-like playback
  • Audio Caching — Built-in caching to reduce bandwidth and enable offline playback
  • Remote Controls — Lock screen, notification controls, and headset support out of the box
  • React HooksusePlaybackState, useIsPlaying, useProgress, useActiveMediaItem, and more

Requirements

  • React Native 0.74 or later
  • New Architecture enabled (Fabric + TurboModules)

Installation

npm install @rntp/player

Then for iOS:

cd ios && pod install

Android links automatically.

Quick Start

import TrackPlayer from '@rntp/player';

// 1. Set up the player (call once at app startup, in the foreground on Android)
await TrackPlayer.setupPlayer({
  contentType: 'music',
  handleAudioBecomingNoisy: true,
  android: { wakeMode: 'network' },
});

// 2. Add tracks and play
await TrackPlayer.setMediaItems([
  {
    url: 'https://example.com/track.mp3',
    title: 'Track Title',
    artist: 'Artist Name',
    artwork: 'https://example.com/artwork.jpg',
  },
]);

TrackPlayer.play();
// 3. Use hooks in your UI
import { useIsPlaying, useProgress, useActiveMediaItem } from '@rntp/player';

function PlayerUI() {
  const { playing } = useIsPlaying();
  const { position, duration } = useProgress();
  const track = useActiveMediaItem();

  return (/* your player UI */);
}

Documentation

Full documentation, API reference, and guides are available at rntp.dev.

V5

V5 is a complete rewrite and is not backwards-compatible with V4.

Key improvements in V5:

  • Built on JSI — getProgress(), getQueue(), isPlaying() return synchronously
  • Full TurboModule and Fabric support
  • Rewritten Android and iOS native layers

License

Free for non-commercial use. Commercial use requires a license.

See license.txt for details or visit rntp.dev/pricing to purchase a commercial license.

For questions: team@doublesymmetry.com

関連リポジトリ
react/react-native

A framework for building native applications using React

C++MIT Licenseandroidapp-framework
reactnative.dev
126.2k25.2k
facebook/react-native

A framework for building native applications using React

C++MIT Licenseandroidapp-framework
reactnative.dev
120.9k24.5k
justjavac/free-programming-books-zh_CN

:books: 免费的计算机编程类中文书籍,欢迎投稿

GNU General Public License v3.0pythonjavascript
weibo.com/justjavac
117.7k28.2k
storybookjs/storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation

TypeScriptnpmMIT Licensestorybookstyleguide
storybook.js.org
90.6k10.2k
enaqx/awesome-react

A collection of awesome things regarding React ecosystem

reactreact-native
74k7.6k
appwrite/appwrite

Appwrite® - complete cloud infrastructure for your web, mobile and AI apps. Including Auth, Databases, Storage, Functions, Messaging, Hosting, Realtime and more

TypeScriptnpmBSD 3-Clause "New" or "Revised" Licenseappwritedocker
appwrite.io
56.6k5.6k
laurent22/joplin

Joplin - the privacy-focused note taking app with sync capabilities for Windows, macOS, Linux, Android and iOS.

TypeScriptnpmOtherreact-nativenodejs
joplinapp.org
55.7k6.2k
dkhamsing/open-source-ios-apps

:iphone: Collaborative List of Open-Source iOS Apps

Creative Commons Zero v1.0 Universaliosswift
51.3k6k
expo/expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.

TypeScriptnpmMIT Licensemobileexpo
docs.expo.dev
50.9k13.1k
react-hook-form/react-hook-form

📋 React Hooks for form state management and validation (Web + React Native)

TypeScriptnpmMIT Licensetypescriptreact-hooks
react-hook-form.com
44.8k2.5k
sudheerj/reactjs-interview-questions

List of top 500 ReactJS Interview Questions & Answers....Coding exercise questions are coming soon!!

JavaScriptnpmMIT Licensereactjsreact-router
44.7k10.4k
mattermost/mattermost

Mattermost is an open source platform for secure collaboration across the entire software development lifecycle..

TypeScriptnpmOthercollaborationmattermost
mattermost.com
38.5k8.9k