Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sina-byn/re-audio
A highly customizable React audio player library with support for modern web audio features and seamless integration into any React application.
https://github.com/sina-byn/re-audio
audio audio-player javascript media-player music-player re-audio react react-component react-hooks typescript
Last synced: 1 day ago
JSON representation
A highly customizable React audio player library with support for modern web audio features and seamless integration into any React application.
- Host: GitHub
- URL: https://github.com/sina-byn/re-audio
- Owner: sina-byn
- License: mit
- Created: 2024-08-05T10:45:17.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-19T06:53:41.000Z (18 days ago)
- Last Synced: 2024-10-19T15:15:07.903Z (18 days ago)
- Topics: audio, audio-player, javascript, media-player, music-player, re-audio, react, react-component, react-hooks, typescript
- Language: TypeScript
- Homepage: https://sina-byn.github.io/re-audio/
- Size: 35.9 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# re-audio [![NPM version](https://img.shields.io/npm/v/@sina_byn/re-audio.svg?style=flat)](https://www.npmjs.com/package/@sina_byn/re-audio) [![NPM monthly downloads](https://img.shields.io/npm/dm/@sina_byn/re-audio.svg?style=flat)](https://npmjs.org/package/@sina_byn/re-audio) [![NPM total downloads](https://img.shields.io/npm/dt/@sina_byn/re-audio.svg?style=flat)](https://npmjs.org/package/@sina_byn/re-audio)
> Creating audio players in React has never been easier
![re-audio banner](/public/banner.png)
> Make sure to visit the documentation website at [https://sina-byn.github.io/re-audio/](https://sina-byn.github.io/re-audio/)
- Built with TypeScript for seamless integration in TypeScript projects
- Fully customizable with a headless component architecture
- Developer-friendly with an intuitive API
- Includes custom React hooks for easily creating audio visualizers## Installation
```bash
npm i --save @sina_byn/re-audio
```## Usage
```tsx
// * AudioPlayer.tsximport { Audio, formatTime } from '@sina_byn/re-audio';
// * components
import PlayBackControls from './PlayBackControls';const AudioPlayer = () => {
return () => (
{audioContext => (
{formatTime(audioContext.currentTime)}
/
{formatTime(audioContext.duration)}
)}
);
};export default AudioPlayer;
``````tsx
// * PlayBackControls.tsximport { useAudio } from '@sina_byn/re-audio';
const PlayBackControls = () => {
const { playing, togglePlay, prevTrack, nextTrack } = useAudio();return (
<>
prev
{playing ? 'pause' : 'play'}
next
>
);
};export default PlayBackControls;
```