Player
"use client";
import { Player } from "@clxrity/react-audio";
export default function PlayerExample() {
return (
<Player
src="/drooms.wav"
/>
);
}
Features
- Provides a simple audio player interface.
- Supports play, pause, and stop functionalities.
- Displays current playback time and duration.
- Allows volume control and mute functionality.
Props
Property | Type | Description | Required | Default Value |
---|---|---|---|---|
src | string | The source URL of the audio file. | ✅ | undefined |
size | number | The size of the player. | ❌ | undefined |
color | string | The color of the player. | ❌ | rgb(236, 106, 177) |
autoplay | boolean | Whether the audio should start playing automatically. | ❌ | false |
loop | boolean | Whether the audio should loop. | ❌ | false |
showProgress | boolean | Whether to show the progress bar. | ❌ | true |
showVolume | boolean | Whether to show the volume control. | ❌ | true |
showNextPrevControls | boolean | Whether to show the next and previous controls (used within ShufflePlayer). | ❌ | false |
audioRef | RefObject<HTMLAudioElement | null> | A ref to the audio element. | ❌ | undefined |
onNext | () => void | Callback function for the next button. (used within ShufflePlayer) | ❌ | undefined |
onPrev | () => void | Callback function for the previous button. (used within ShufflePlayer) | ❌ | undefined |
Last updated on