An Mp3 player to play any audio file based on ReactJS
Install via NPM
npm install react-mp3-playeror use yarn
yarn add react-mp3-playerImport the Playlist component
import Playlist from 'react-mp3-player';The tracks format will be ann array of objects, each object containing a name, description, src mp3 and an optional image
const tracks = [{ img: 'https://icon-library.net/images/music-icon-transparent/music-icon-transparent-11.jpg', name:'MP3', desc: 'Description 1', src:'Audio.mp3'},
{ img: 'https://icon-library.net/images/music-icon-transparent/music-icon-transparent-11.jpg', name:'MP3 #2', desc: 'Description 2', src:'Audio2.mp3'}]Additional properties can be added to the component such as a right or left offset to decrease the width of the player as well as being able to choose the breakpoint for switching to mobile view, these options are passed into the playlist component in an object as props.
const playlistOverideStylingOpts = {
offset : {
left : 300
},
breakpoint : {
maxWidth : 768
}
};Add the Player component and pass it the relative mp3 tracks as well as any addition style options as opts
<Playlist tracks={tracks} opts={playlistOverideStylingOpts}/>Make any changes or additional features in the Player.js component and update the version (in the package.json) by 0.0.1 and then push all your changes to the repo.
Firstly make sure to build to the dist folder. Run
yarn buildThen publish the update to npm by running
npm publishYour update should now be live on NPM. Make sure to update the package in your project by running
yarn upgrade react-mp3-playerLiam Riley - github.com/Liamriley123 Dannish Hussain - github.com/Dannish94 Austin Kershaw - github.com/austinmkershaw



