Installations
npm install react-audio-player
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
14.5.0
NPM Version
6.14.6
Score
81.8
Supply Chain
84.5
Quality
75.7
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (62.61%)
JavaScript (31.32%)
HTML (6.07%)
Developer
justinmc
Download Statistics
Total Downloads
5,522,191
Last Day
1,560
Last Week
23,895
Last Month
133,886
Last Year
1,466,947
GitHub Statistics
591 Stars
187 Commits
103 Forks
8 Watching
40 Branches
20 Contributors
Bundle Size
12.83 kB
Minified
3.31 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.17.0
Package Id
react-audio-player@0.17.0
Size
1.30 MB
NPM Version
6.14.6
Node Version
14.5.0
Publised On
19 Apr 2021
Total Downloads
Cumulative downloads
Total Downloads
5,522,191
Last day
-77.3%
1,560
Compared to previous day
Last week
-29.2%
23,895
Compared to previous week
Last month
-7.2%
133,886
Compared to previous month
Last year
11.9%
1,466,947
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
25
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';
//...
<ReactAudioPlayer
src="my_audio_file.ogg"
autoPlay
controls
/>
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 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 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:
<ReactAudioPlayer
ref={(element) => { 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 for more on these attributes.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 4/11 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 23 are checked with a SAST tool
Reason
74 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-3wcq-x3mq-6r9p
- Warn: Project is vulnerable to: GHSA-6h5x-7c5m-7cr7
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q
- Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5
- Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp
- Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq
- Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr
- Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765
- Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc
- Warn: Project is vulnerable to: GHSA-hh27-ffr2-f2jc
- Warn: Project is vulnerable to: GHSA-rqff-837h-mm52
- Warn: Project is vulnerable to: GHSA-8v38-pw62-9cw2
- Warn: Project is vulnerable to: GHSA-hgjh-723h-mx2j
- Warn: Project is vulnerable to: GHSA-jf5r-8hm2-f872
- Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986
- Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
Score
2.1
/10
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to react-audio-player
react-h5-audio-player
A customizable React audio player. Written in TypeScript. Mobile compatible. Keyboard friendly
react-player
A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion
react-audio-player-pro
React Audio Player Pro provides: single audio, playlist and playlist provider
react-native-audio-recorder-player
React Native Audio Recorder and Player.