Socket
Socket
Sign inDemoInstall

@blackbox-vision/mui-audio-player

Package Overview
Dependencies
62
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @blackbox-vision/mui-audio-player

Material-UI based Audio Player


Version published
Maintainers
1
Created

Readme

Source

MUI Audio Player npm version License: MIT Known Vulnerabilities

Material-UI based Audio Player. Check out the demo.

Installation

NPM

npm i @blackbox-vision/mui-audio-player

YARN

yarn add @blackbox-vision/mui-audio-player

Usage

The usage is really simple:

import React from 'react';
import Grid from '@material-ui/core/Grid';

import pink from '@material-ui/core/colors/pink';
import deepPurple from '@material-ui/core/colors/deepPurple';

import createTheme from '@material-ui/core/styles/createMuiTheme';
import ThemeProvider from '@material-ui/core/styles/MuiThemeProvider';

import { AudioPlayer } from '@blackbox-vision/mui-audio-player';

const theme = createTheme({
  palette: {
    type: 'light',
    primary: deepPurple,
    secondary: pink,
  },
});

export default class App extends React.Component {
  render() {
    return (
      <ThemeProvider theme={theme}>
        <Grid
          justify="center"
          alignContent="center"
          alignItems="center"
          container
          style={{ height: '100vh', backgroundColor: deepPurple['500'] }}
        >
          <Grid md={4} item />
          <Grid md={4} item>
            <AudioPlayer
              src="https://s9.converto.io/download-file/zwXZbmwDyWGN7qkqvVPMcQm0pIajpwdE/file.mp3"
              autoPlay={false}
              rounded={true}
              elevation={1}
              width="100%"
            />
          </Grid>
          <Grid md={4} item />
        </Grid>
      </ThemeProvider>
    );
  }
}

As you can see in the example, this component is pretty well themeable.

Props

These are the properties used by the AudioPlayer component:

PropertiesTypesDefault ValueDescription
srcstringnoneDetermines the url used by the player to load the audio source.
autoPlaybooleanfalseDetermines if the player starts reproducing the audio automatically.
roundedbooleanfalseDetermines if the player container has rounded borders.
elevationnumber1Determines if the player container has box-shadow applied.
widthstring500pxDetermines the width of the player.
heightstring45pxDetermines the height of the player.
classNamesobject{}Determines the classNames to be applied. (*)

(*) classNames is a special property:

PropertiesTypesDefault ValueDescription
classNames.playerstringnoneDetermines the className to be applied to the root container.
classNames.loopIconstringnoneDetermines the classNames to be applied to the loop icon element.
classNames.playIconstringnoneDetermines the classNames to be applied to the play icon element.
classNames.muteIconstringnoneDetermines the classNames to be applied to the mute icon element.
classNames.sliderstringnoneDetermines the classNames to be applied to the slider element.
classNames.trackstringnoneDetermines the classNames to be applied to the track element.
classNames.thumbstringnoneDetermines the classNames to be applied to the thumb element.
classNames.textstringnoneDetermines the classNames to be applied to the text element.

TODO

  • Add volume bar.
  • Add more tests.
  • Add better styles for responsive design.

Issues

Please, open an issue following one of the issues templates. We will do our best to fix them.

Contributing

If you want to contribute to this project see contributing for more information.

License

Distributed under the MIT license. See LICENSE for more information.

FAQs

Last updated on 01 Apr 2019

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