react-native-gliph-player
v1.3.4
Published
A fully-featured, New Architecture (JSI/TurboModules) compatible audio player for React Native. Background playback, media notifications, queue management, lock screen controls, and more.
Maintainers
Readme
🎵 react-native-gliph-player
A high-performance, New Architecture (JSI / TurboModules) compatible audio player for React Native. Built for developers who need absolute control over audio playback, background services, and system integration without fighting complex APIs.
📖 Official Documentation
All documentation, API references, hooks guides, and complete UI examples have been moved to our official website.
👉 View Official Documentation Here 👈
🌟 Features
- New Architecture Ready: Built from the ground up for TurboModules and JSI. No bridge latency.
- Background Playback: Robust Android Foreground Service (Media3) and iOS AVAudioSession management.
- Seamless Notification UI: Automatic integration with system media centers (Lock Screen, Control Center, Android Auto).
- Zero-Lag Seeking: Optimized LoadControl for near-instantaneous seek-and-play response.
- Drop-in React Hooks: Build UIs instantly with automatic re-rendering hooks.
📦 Installation
npm install react-native-gliph-player
# or
yarn add react-native-gliph-playeriOS Configuration
Run pod install in your ios directory and enable audio background modes in your Info.plist:
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>Android Configuration
Android handles most setup via autolinking. However, to show playback notifications (which is required for background play on Android 13+), you need the POST_NOTIFICATIONS permission.
For detailed manual installation instructions (if you use custom services or if autolinking fails), visit the Installation Guide.
🚀 Quick Start
Initialize the player and add tracks:
import GliphPlayer from 'react-native-gliph-player';
// 1. Setup
await GliphPlayer.setupPlayer();
// 2. Add Tracks
await GliphPlayer.add([
{
id: '1',
url: 'https://example.com/audio.mp3',
title: 'Awesome Song',
artist: 'Gliph Labs',
artwork: 'https://example.com/cover.jpg',
}
]);
// 3. Play!
await GliphPlayer.play();Note: For a full production-ready implementation including background events, lock screen configurations, and reactive hooks (
usePlaybackState,useProgress), please refer to our Official Guide.
📄 License
MIT
