1.0.1 • Published 1 year ago

@logicsquare/react-audio-player v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

React Audio Player

  • Custom audio player component with support for different browsers.
  • Written in TypeScript
  • Highly customizable layout
  • Mobile responsive

Supported browsers: Chrome, Firefox, Safari, Edge

Installation

$ npm i @logicsquare/react-audio-player

OR

$ yarn add @logicsquare/react-audio-player

Usage

import CustomAudioPlayer from "@logicsquare/react-audio-player";

const Player = () => (
  <CustomAudioPlayer
    theme="#ff9900"
    media={[
      {
        title: "Some Title 1",
        url: "http://example.com/audio1.mp3",
        thumbnail: "http://example.com/thumbnail1.jpg",
        artist: "Artist Name 1",
      },
      {
        title: "Some Title 2",
        url: "http://example.com/audio2.mp3",
        thumbnail: "http://example.com/thumbnail2.jpg",
        artist: "Artist Name 2",
      },
    ]}
    // other props here
  />
);

Keyboard shortcuts (When audio player focused)

They can be turned off by setting hasDefaultKeyShortcuts prop to false

Key bindingAction
SpacePlay/Pause
Skip Backward
Skip Forward
Volume up
Volume down
MToggle mute

Player Props

PropsTypeDefaultNote
theme (optional)string#000000Set theme of the player
mediaArray<object>undefinedPass an array of objects where each object contains audio details
skipTime (optional)number10Set the time in seconds for skipping audio forward or backward
showSkipButtons (optional)booleantrueShow skip buttons for skipping forward and backward
showVolumeControl (optional)booleantrueShow volume control for adjusting volume
showPlaybackSpeedControls (optional)booleantrueShow playback speed controls for adjusting playback speed
hasDefaultKeyShortcuts (optional)booleantrueWheather to have default keyboard shortcuts

How to contribute

Issues and PR's are welcome.

1.0.1

1 year ago

1.0.0

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago