ShufflePlayer
The <ShufflePlayer />
component is built off of the Player component, adding the ability to play multiple audio files.
"use client";
import { ShufflePlayer } from "@clxrityy/react-audio";
export default function Example() {
return (
<ShufflePlayer
srcs={[
"/audio/strings.wav",
"/audio/drums_2.wav",
"/audio/drums.wav",
]}
/>
);
}
Props
Property | Type | Description | Required | Default Value |
---|---|---|---|---|
srcs | string[] | An array of source URLs for the audio files. | ✅ | undefined |
autoplay | boolean | Whether the audio should start playing automatically. | ❌ | false |
color | string | The color of the player. | ❌ | rgb(236, 106, 177) |
showNextPrevControls | boolean | Whether to show the next and previous controls. | ❌ | true |
showProgress | boolean | Whether to show the progress bar. | ❌ | true |
showVolume | boolean | Whether to show the volume control. | ❌ | true |
shuffle | boolean | Whether to shuffle the audio files. If true, a random file will be played each time. | ❌ | false |
Last updated on