All Projects → react-native-kit → React Native Track Player

react-native-kit / React Native Track Player

Licence: apache-2.0
A fully fledged audio module created for music apps. Provides audio playback, external media controls, chromecast support, background mode and more!

Programming Languages

java
68154 projects - #9 most used programming language
C++
36643 projects - #6 most used programming language
swift
15916 projects
typescript
32286 projects
objective c
16641 projects - #2 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Track Player

react-native-track-player
A fully fledged audio module created for music apps. Provides audio playback, external media controls, chromecast support, background mode and more!
Stars: ✭ 2,348 (+7.95%)
Mutual labels:  music-player, music-library, media-control
Simple Netease Cloud Music
🎵A simple netease music api lib. 简单、统一、轻巧的 Node.js 版网易云音乐 API
Stars: ✭ 268 (-87.68%)
Mutual labels:  music-player, music-library
Olivia
Elegant music player for LINUX
Stars: ✭ 261 (-88%)
Mutual labels:  music-player, music-library
Diffuse
A music player that connects to your cloud/distributed storage.
Stars: ✭ 517 (-76.23%)
Mutual labels:  music-player, music-library
flutter-tunein
Dynamically themed Music Player built with flutter
Stars: ✭ 108 (-95.03%)
Mutual labels:  music-player, music-library
ytqck.github.io
YouTube quick ⚡ Search and Download Music for Free.
Stars: ✭ 18 (-99.17%)
Mutual labels:  music-player, music-library
Tauonmusicbox
The Linux desktop music player from the future! 🌆
Stars: ✭ 494 (-77.29%)
Mutual labels:  music-player, music-library
Musikcube
a cross-platform, terminal-based music player, audio engine, metadata indexer, and server in c++
Stars: ✭ 2,663 (+22.44%)
Mutual labels:  music-player, music-library
Quodlibet
Music player and music library manager for Linux, Windows, and macOS
Stars: ✭ 918 (-57.79%)
Mutual labels:  music-player, music-library
Starrysky
🔥A Powerful and Streamline MusicLibrary(一个丰富的音乐播放封装库,支持多种音频格式,完美解决你的问题。)
Stars: ✭ 1,022 (-53.01%)
Mutual labels:  music-player, music-library
Guayadeque
Guayadeque is a music management program designed for all music enthusiasts. It is Full Featured Linux media player that can easily manage large collections and uses the Gstreamer media framework.
Stars: ✭ 87 (-96%)
Mutual labels:  music-player, music-library
Nicemusic
A Nice MusicPlayer Powered by StarrySky
Stars: ✭ 107 (-95.08%)
Mutual labels:  music-player, music-library
HypnosMusicPlayer
A Lightweight, Clean, and Powerful Music Player and Library.
Stars: ✭ 21 (-99.03%)
Mutual labels:  music-player, music-library
ManaZeak
ManaZeak is a self-hostable web app that give you the ability to listen, edit and share your musical library over the internet.
Stars: ✭ 16 (-99.26%)
Mutual labels:  music-player, music-library
vue-music-player
🎵 basic music player, keeps your favorite musics
Stars: ✭ 77 (-96.46%)
Mutual labels:  music-player, music-library
Hyperamp
🎛 Humble music player
Stars: ✭ 293 (-86.53%)
Mutual labels:  music-player, music-library
Jetpack Musicplayer
即使不用云音乐听曲儿,也请务必收藏好该库!🔥 一行代码即可接入,音乐播放控制组件 - Even if you don't listen to the music by Spotify, be sure to collect this library, please! 🔥 This music player component can be accessed by only one line of code. Supporting by LiveData & AndroidX.
Stars: ✭ 577 (-73.47%)
Mutual labels:  music-player, music-library
Musicott
JavaFX application that manages and plays music files.
Stars: ✭ 97 (-95.54%)
Mutual labels:  music-player, music-library
Rompr
Web client for Mopidy and MPD
Stars: ✭ 115 (-94.71%)
Mutual labels:  music-player, music-library
Dmusic
DMusic Player for Android - An online music player based on Component + MVP Base + MVP Customization + greenDAO + OkHttp3 + Retrofit + RxJava2; supports local and network music playback; can play Baidu music, Netease cloud music; support online music list , radio, MV, music online, download, local and online lyrics; Lyrics, music cache; self-built song list, song management, collection, sorting, sorting, skinning, sleep timing, mode switching, more settings, etc. 基于 Component + MVP Base + MVP Customization + greenDAO + OkHttp3 + Retrofit + RxJava2 的在线音乐播放器; 支持本地及网络音乐播放; 可播放百度音乐,网易云音乐; 支持在线音乐榜单, 电台, MV, 音乐在线播放,下载, 本地及在线歌词; 歌词, 音乐缓存; 自建歌单, 歌曲管理, 收藏, 排序, 分类, 换肤, 睡眠定时, 模式切换, 更多设置等
Stars: ✭ 121 (-94.44%)
Mutual labels:  music-player

downloads npm discord

A fully-fledged audio module created for music apps. Provides audio playback, external media controls, background mode and more!

react-native-track-payer 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 ($1000+ per month):
Become the first gold sponsor!

🥈 Silver sponsors ($500+ per month):
Become the first siver sponsor!

🥉 Bronze sponsors ($200+ per month):
Become the first bronze sponsor!

Contributing sponsors ($25+ per month):
Radio Garden


⚠️ 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

Quick Guides

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].