New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-mp3-player

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-mp3-player

An Mp3 player to play any audio file based on ReactJS

latest
Source
npmnpm
Version
0.8.2
Version published
Weekly downloads
13
-31.58%
Maintainers
1
Weekly downloads
 
Created
Source

React mp3 Player

An Mp3 player to play any audio file based on ReactJS

Table of Contents

  • Installation
  • Usage
  • Screenshots
  • Adding-new-icons-to-the-library
  • Contributing

Installation

Install via NPM

npm install react-mp3-player

or use yarn

yarn add react-mp3-player

Usage

Import 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}/>

Screenshots

Desktop Alt text

Desktop Hidden Alt text

Mobile Alt text

Mobile Hidden Alt text

Adding new features to the mp3

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.

Publish to NPM

Firstly make sure to build to the dist folder. Run

yarn build

Then publish the update to npm by running

npm publish

Your update should now be live on NPM. Make sure to update the package in your project by running

yarn upgrade react-mp3-player

Contributors

Liam Riley - github.com/Liamriley123 Dannish Hussain - github.com/Dannish94 Austin Kershaw - github.com/austinmkershaw

Keywords

mp3

FAQs

Package last updated on 11 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts