带有自定义控制、播放列表、过滤器和搜索功能的音乐播放器。
Node.js 18.x / 20+ is required.
Tested on React 18.2.0 and NextJS 14.1.0.
npm install @madzadev/audio-playerimport Player from "@madzadev/audio-player";
import "@madzadev/audio-player/dist/index.css";const tracks = [
{
url: "https://audioplayer.madza.dev/Madza-Chords_of_Life.mp3",
title: "Madza - Chords of Life",
tags: ["house"],
},
{
url: "https://audioplayer.madza.dev/Madza-Late_Night_Drive.mp3",
title: "Madza - Late Night Drive",
tags: ["dnb"],
},
{
url: "https://audioplayer.madza.dev/Madza-Persistence.mp3",
title: "Madza - Persistence",
tags: ["dubstep"],
},
];The only mandatory prop is trackList for audio source.
It requires to pass in an array consisting of objects with url, title and tags keys.
There are multiple optional props you can use to configure the player.
The default values of them are displayed below.
You can customize the design of the player by editing the colors object below.
Include only those properties, that you want to customize.
…The audio files can be stored and accessed both locally in your project via file path (e.g., public/yourtrack.mp3) or using external host and providing direct URL to the source (e.g., https://website.com/yourtrack.mp3).
This project is under MIT license, so be free to check it out and contribute!
暂无开放 Issues,或尚未同步最近议题。