๐ Features
- ๐ต Powered by Media3 (Android) & AVFoundation (iOS)
- ๐ Lock screen controls & background playback
- ๐ Automatic handling of notification center (Android & iOS)
- ๐ก Comprehensive media support:
- Static remote files
- Live streams (HLS, DASH, RTSP, RTMP)
- Local files (audio and artwork)
- ๐ Isolated ambient audio system for background sounds
- ๐ฆ Built fully in TypeScript โ no JS wrappers
- ๐ง Simple React hook & module interface
- โก๏ธ Lightweight, fast, and production-ready
๐ง React Hook in Action
import { useAudioPro } from 'react-native-audio-pro';
export default function Player() {
const { state, duration, position, ...etc } = useAudioPro();
return (
<View>
<Text>State: {state}</Text>
<Text>Position: {position} / {duration}</Text>
</View>
);
}
๐งฉ Module in Action
import {AudioPro} from 'react-native-audio-pro';
AudioPro.configure({ contentType: 'speech' });
const track = {
id: 'track-001',
url: 'https://example.com/audio-book.mp3'
title: 'The Best Book Ever',
artwork: 'https://example.com/nice-picture.jpg',
};
AudioPro.play(track);
// or
AudioPro.play(track, {
autoPlay: false,
headers: {
audio: { 'Authorization': 'Bearer token123' },
artwork: { 'Cache-Control': 'max-age=3600' }
}
});
๐ Ambient Audio
Aan isolated ambient audio system for playing background sounds independently from the main player.
import { AudioPro } from 'react-native-audio-pro';
AudioPro.ambientPlay({
url: 'https://example.com/nature-sounds.mp3',
loop: true,
});
AudioPro.ambientStop();
AudioPro.ambientSetVolume(0.5);
Documentation
For full setup and API reference, see the GitHub README.
- ๐ Full API for
AudioPro
module anduseAudioPro
hook - ๐ฆ Details on payloads, types, and setup options
- ๐งช Example app demonstrating integration and usage
- ๐ง Platform-specific setup (Android & iOS)
๐ Ready to build?
Check it out and let us know how you go! If you run into any issues, log an issue โ weโll squash bugs fast. ๐ช