NOTE: Like autoplayDelayInSeconds, this delay is inexact.Ĭycle: a boolean value that if true continues playing from the beginning after the playlist has completed. Not applicable for manually-initiated skip. GapLengthInSeconds: a number value that represents the number of seconds to wait at the end of a track before beginning the next one in the playlist. If you need to time an autoplay exactly, find a different module that uses the WebAudio API for playback (or fork this one!). NOTE: Delay is managed by setTimeout and is therefore inexact. false by default.ĪutoplayDelayInSeconds: a number value that represents the number of seconds to wait until beginning autoplay. spacer class can be overridden)Īutoplay: a boolean value ( true/ false) that if true will cause the player to begin automatically once mounted. 'spacer' (a transparent space-filling element whose default width is 10px, although the style of the.'progressdisplay' (a read-only progress bar).'progress' (a drag-to-seek audio progress bar).'backskip' (previous track skip button).The order of keywords translates to the order of rendered controls. meta: An object containing any other track-specific information you want to storeĬontrols: an array of keyword strings which correspond to available audio control components.artwork: The artwork for the track - corresponds to the MediaMetadata.artwork property.album: The album the track belongs to - corresponds to the MediaMetadata.album property.artist: The track's artist - corresponds to the MediaMetadata.artist property.title: The title of the track - corresponds to the MediaMetadata.title property.url ( required): A string containing the address of the audio file to play.Each track object can contain the following properties: Playlist ( required): an array containing data about the tracks which will be played. Options can be passed to the AudioPlayer element as props. Be sure to check the Styling section below. When you first include the component in your project it might not look how you're expecting. While react-dom isn't technically a peer dependency, you'll need it if you plan to place the audio player in the DOM, which you probably will. It's recommended that you install the package and its dependencies in your project: npm install -save react-responsive-audio-player react react-dom Of course you'll need to include paths to actual audio files, or the player will display and not work. React.createElement(AudioPlayer, ] Ĭontrols: JavaScript (without JSX): // dist/main.js Var AudioPlayer = require('react-responsive-audio-player') ĭocument.getElementById('audio_player_container')
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |