Socket
Socket
Sign inDemoInstall

react-howler-player

Package Overview
Dependencies
9
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-howler-player

React package to display minimalist audio player UI adding wrapper on howler.js


Version published
Weekly downloads
22
increased by37.5%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-howler-player

release open-issues license Test Status Build Status

This is a simple, accessible audio player built using Reactjs and Howlerjs. view demo

howler.js

Javascript audio library for the modern web. howler.js makes working with audio in JavaScript easy and reliable across all platforms.

Usage

npm install --save howler react-howler-player
import React, { Component } from "react";
import Player from "react-howler-player";

const App = () => {
    const onPlayerReady = (data) => {
        console.log(data);
    };

    const timeUpdate = (data) => {
        console.log(data);
    };

    return (
        <div>
            <Player
                src={["audio file URL"]}
                isDark={true}
                onTimeUpdate={timeUpdate}
                onLoad={onPlayerReady}
            />
        </div>
    );
};

Example

git clone git@github.com:binodswain/react-howler-player.git
cd react-howler-player
npm i
npm run build

cd example
npm i
npm start

This will start a React app (bootstrapped with create-react-app) with multiple player instances. One player instance with remote URL and one with local file.

Screenshots

Default Player

Screenshot 1

Player with dark mode

Screenshot 2

Props passed to component

attributetypeoptionaldetails
srcArrayfalseSource of audio playback
isDarkBooleantrueFlag to switch between light and dark theme
onTimeUpdatefunctiontrueOn playback progress, timestamp obj is passed to the function
loadingTextfunctiontrueText displayed while preparing the playback.(default val: 'Preparing')
preparingCompJSX Comp.trueComponent to display instead of loading text. `(preparingComp
speedPanelstringtruePosition of audio playback rate list. ('top', 'bottom', 'relative'). defaultVal : 'relative'
onLoadfunctiontrueCallback function that passes howler audio instance and couple of basic information
onPlayfunctiontrueCalled when audio starts or resumes playing
onPausefunctiontrueCalled when audio is paused
onEndfunctiontrueCalled when media finishes playing
profilestringtruePlayer profile. ['generic', 'minimal', 'top_progress']

Features:

  • Clean: uses semantic elements for UI.
  • Controls: supports Keyboard events/ controls.
  • Audio Format: supports a wide range of audio format.

License

MIT © binodswain

Keywords

FAQs

Last updated on 07 Aug 2022

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc