pax_global_header 0000666 0000000 0000000 00000000064 14037220624 0014512 g ustar 00root root 0000000 0000000 52 comment=27b0de14b6dce16723430b42e4cfabd3af295b78
react-audio-player-0.17.0/ 0000775 0000000 0000000 00000000000 14037220624 0015266 5 ustar 00root root 0000000 0000000 react-audio-player-0.17.0/.babelrc 0000664 0000000 0000000 00000000436 14037220624 0016664 0 ustar 00root root 0000000 0000000 {
"presets": [
"@babel/preset-env",
"@babel/preset-react",
[
"@babel/preset-typescript",
{
"isTSX": true,
"allExtensions": true
}
]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"react-hot-loader/babel"
]
}
react-audio-player-0.17.0/.eslintrc 0000664 0000000 0000000 00000000461 14037220624 0017113 0 ustar 00root root 0000000 0000000 {
"extends": "airbnb",
"globals": {
"document": true,
},
"rules": {
"jsx-a11y/media-has-caption": 0,
"no-unused-expressions": [2, { "allowShortCircuit": true }],
"prefer-destructuring": 0,
"react/destructuring-assignment": 0 ,
"react/jsx-one-expression-per-line": 0
}
}
react-audio-player-0.17.0/.gitignore 0000664 0000000 0000000 00000000054 14037220624 0017255 0 ustar 00root root 0000000 0000000 dist/
node_modules/
.DS_Store
npm-debug.log
react-audio-player-0.17.0/.npmignore 0000664 0000000 0000000 00000000064 14037220624 0017265 0 ustar 00root root 0000000 0000000 src/
example/
spec/
karma.conf.js
webpack.config.js
react-audio-player-0.17.0/LICENSE 0000664 0000000 0000000 00000002074 14037220624 0016276 0 ustar 00root root 0000000 0000000 The MIT License (MIT)
Copyright (c) 2016 Justin McCandless
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
react-audio-player-0.17.0/README.md 0000664 0000000 0000000 00000006637 14037220624 0016561 0 ustar 00root root 0000000 0000000 # React Audio Player
This is a light React wrapper around the HTML5 audio tag. It provides the ability to manipulate the player and listen to events through a nice React interface.
## Installation
npm install --save react-audio-player
Also be sure you have `react` and `react-dom` installed in your app at version 15 or above.
## Usage
import ReactAudioPlayer from 'react-audio-player';
//...
### Example
See the example directory for a basic working example of using this project. To run it locally, run `npm install` in the example directory and then `npm start`.
## Props
### Props - Native/React Attributes
See the [audio tag documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio) for detailed explanations of these attributes.
Prop | Type | Default | Notes
--- | --- | --- | ---
`autoPlay` | Boolean | false | ---
`children` | Element | null | ---
`className` | String | *empty string* | ---
`controls` | Boolean | false | ---
`crossOrigin` | String | *empty string* | See [MDN's article on CORS](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for more about this attribute.
`controlsList` | String | *empty string* | For Chrome 58+. Only available in React 15.6.2+
`id` | String | *empty string* | ---
`loop` | Boolean | false | ---
`muted` | Boolean | false | ---
`volume` | Number | 1.0 | ---
`preload` | String | 'metadata' | ---
`src` | String | *empty string* | ---
`style` | Object | --- | ---
### Props - Events
Prop | Type | Description
--- | --- | ---
`listenInterval` | Number | Indicates how often to call the `onListened` prop during playback, in milliseconds. Default is 10000.
`onAbort` | Function | called when unloading the audio player, like when switching to a different src file. Passed the event.
`onCanPlay` | Function | called when enough of the file has been downloaded to be able to start playing. Passed the event.
`onCanPlayThrough` | Function | called when enough of the file has been downloaded to play through the entire file. Passed the event.
`onEnded` | Function | called when playback has finished to the end of the file. Passed the event.
`onError` | Function | called when the audio tag encounters an error. Passed the event.
`onListen` | Function | called every `listenInterval` milliseconds during playback. Passed the event.
`onPause` | Function | called when the user pauses playback. Passed the event.
`onPlay` | Function | called when the user taps play. Passed the event.
`onSeeked` | Function | called when the user drags the time indicator to a new time. Passed the event.
`onVolumeChanged` | Function | called when the user changes the volume, such as by dragging the volume slider |
`onLoadedMetadata` | Function | called when the metadata for the given audio file has finished downloading. Passed the event.
## Advanced Usage
### Access to the audio element
You can get direct access to the underlying audio element. First get a ref to ReactAudioPlayer:
{ this.rap = element; }}
/>
Then you can access the audio element like this:
this.rap.audioEl
This is especially useful if you need access to read-only attributes of the audio tag such as `buffered` and `played`. See the [audio tag documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio) for more on these attributes.
react-audio-player-0.17.0/example/ 0000775 0000000 0000000 00000000000 14037220624 0016721 5 ustar 00root root 0000000 0000000 react-audio-player-0.17.0/example/.babelrc 0000664 0000000 0000000 00000000173 14037220624 0020315 0 ustar 00root root 0000000 0000000 {
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"react-hot-loader/babel"
]
}
react-audio-player-0.17.0/example/files/ 0000775 0000000 0000000 00000000000 14037220624 0020023 5 ustar 00root root 0000000 0000000 react-audio-player-0.17.0/example/files/George_Gershwin_playing_Rhapsody_in_Blue.ogg 0000664 0000000 0000000 00021027446 14037220624 0030650 0 ustar 00root root 0000000 0000000 OggS 43vorbis D OggS H}Cvorbis OggS v
vorbisBCV tY"@А `"1 4d% hBk78hRlN'Rmbn9s9gs9(gfBk9'1hfBk9IlJk9gs:gq9Ikfcm9gAkRl9'RnRm9s9s9zq:s9'jo&tq9q7's9s9s9'
Y acw
9QLz=:L z4:)BIe BCV BH!RH!RH!b!r)J*(2,2,;C1J+T[5֚{ι ZkRJ)А AdRH!b)
* 4d% !ghhq "L:
)j1^:{RJ)RJ)RJ)%
Y !RH!R1s: %BCV ` 1dAH!b)s:!RRh\j%VZjXs1{{{А @ " 1! @ b1 R!L2餣!+ ' G$qg* B,ZkZkZkZkZkZk- `ADAdА #@c9tA'Z 4d% @ 20UTQFURG)RJ)RJ)RJ)RJ)RJ)TJ)BCV d R)-E"KFsPZrRͩR $1T2BBuL)-BrKs
Y! f 8,, $M4, I 4
<< 4