0.1.9 • Published 5 years ago

material-ui-audio v0.1.9

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

Usage

npm install material-ui-audio # or yarn add material-ui-audio
import React from 'react'
import MaterialUIAudio from 'material-ui-audio'

// Relative URL - play an audio from same origin
<MaterialUIAudio src={'/audio.mp3'} />

// Absolute URL - play an audio from external source
<MaterialUIAudio src={'https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_1MG.mp3'} />

// Promise retrieve URL
<MaterialUIAudio src={fetch('<my url>')} />

Props

PropDescriptionDefault
srcstring or Promise<string> - The url of an audio to play  Can be a relative or absolute url A Promise resolved into a string (the url) after Play button clicked. This case can be useful when you are using Firebase Storage, where you need to call an API to retrieve the download Url.(mandatory)
forwardSet to true or falsy to show forward buttonundefined
backwardSet to true or falsy to show backward buttonundefined
autoplaySet to true or falsy to set autoplay on audioundefined
loopSet to true or falsy to set loop on audioundefined
widthSet the width of the playerundefined (fit parent container)
speedSet to true or falsy to show speed controlundefined

Callback props

Callback props take a function that gets fired on various player events:

PropDescription
onForwardClickCalled when forward button is clicked
onBackwardClickCalled when backward button is clicked
onEndedCalled when audio ended

Please note:

This module has following peerDependencies: React (>=17.0.0) Material UI (@material-ui/core: >=4.0.0, @material-ui/icons: >=4.0.0).

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago