@javascriptcommon/react-native-track-player

中文文档
4.1.95发布于 2026/11/01Apache-2.0TypeScriptCommonJS零依赖

A fully fledged audio module created for music apps

原始使用文档

Android compile check

Please note this is a personal fork of RNTP for APM's development. Its forked out of upstream because RNTP unfortunately was on a development hiatus and the community has been quiet for a very long time, while the entire react native community 1,2 does NOT have anything better for audio playback. Many of the features APM uses, such as crossfade and Android Auto capabilities, were NOT merged upstream, unlikely to be merged in the foreseeable future, and won't be seen elsewhere either.

Functionalities used by APM passes the play store review.

This fork and APM proudly remains open-source and APM is published under GPLv3. As this fork is specifically developed for APM, contributions are welcome but changes modifying any APM features will NOT be accepted. For feature usages it's encouraged to look at the example app and APM. For library usages it's recommend to FORK yourself and modify any APM specific features and resources as needed.

版本与发布记录

@javascriptcommon/react-native-track-player 共发布 90 个版本,首次发布于 2025/06/11;过去 12 个月发布了 83 个版本。

版本发布日期距今
4.1.95latest2026/11/012 天前
4.1.942026/11/012 天前
4.1.932026/11/012 天前
4.1.922026/11/012 天前
4.1.912026/11/012 天前
4.1.902026/11/012 天前

关于 @javascriptcommon/react-native-track-player 的常见问题

@javascriptcommon/react-native-track-player 是什么?

一个完全成熟的音频模块创建的音乐应用程序

如何安装 @javascriptcommon/react-native-track-player?

在项目目录运行 npm install @javascriptcommon/react-native-track-player,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(*)、react-native(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@javascriptcommon/react-native-track-player 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@javascriptcommon/react-native-track-player 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@javascriptcommon/react-native-track-player 可以商用吗?

@javascriptcommon/react-native-track-player 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@javascriptcommon/react-native-track-player 还在维护吗?

最新版本 4.1.95 发布于 2026/11/01(2 天前);至今共发布 90 个版本,其中过去 12 个月发布了 83 个;首次发布于 2025/06/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。