1.0.5 • Published 5 years ago

mix-button v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

mix-button

This is a library to easily play and configure audio on HTML elements.

Install

npm install mix-button --save
or
yarn add mix-button

Usage

import MixButton from 'mix-button'

import audio from './some-audio.wav'

render () {

  return (
    <MixButton 
      audio={audio}
      style={{width: 50, height: 50}}
    />
  )
}

MixButton properties

PropTypeDescription
audiostringThe audio to play when the element is clicked.
shortcutnumberThe key code of some key of keyboard to play the audio when pressed.
volumenumberThe volume of the audio (between 0-1).
continuousbooleanIf the audio should play continuously.
onPlayFunctionTriggered when the audio starts.
onStopFunctionTriggered when the audio stops.
elementstringThe element that should be rendered (Default is 'div').
mutedbooleanMute the audio.

License

MIT © daniellrs

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago