Gathering detailed insights and metrics for apm-react-audio-player
Gathering detailed insights and metrics for apm-react-audio-player
npm install apm-react-audio-player
Typescript
Module System
Min. Node Version
Node Version
NPM Version
55.7
Supply Chain
28.5
Quality
88
Maintenance
100
Vulnerability
99.3
License
JavaScript (80.16%)
CSS (19.84%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
4,158
Last Day
4
Last Week
27
Last Month
111
Last Year
3,197
57 Commits
5 Watchers
9 Branches
8 Contributors
Updated on Jan 09, 2025
Minified
Minified + Gzipped
Latest Version
1.0.26
Package Id
apm-react-audio-player@1.0.26
Unpacked Size
23.70 kB
Size
6.29 kB
File Count
3
NPM Version
10.2.3
Node Version
20.10.0
Published on
Jan 09, 2025
Cumulative downloads
Total Downloads
Last Day
33.3%
4
Compared to previous day
Last Week
58.8%
27
Compared to previous week
Last Month
-58.6%
111
Compared to previous month
Last Year
364.7%
3,197
Compared to previous year
2
1
24
This is a light react audio player that is wrapped around a HTML5 audio tag, created for use on American Public Media and Minnesota Public Radio's websites.
The library was designed to add a audio player to a body of a story which will not trigger the static audio player.
[License] (#License)
As of version 1.0.0, this library has no dependencies for usage.
There are several ways to install APM Player on your site.
1npm install apm-react-audio-player
or to use yarn:
1yarn add apm-react-audio-player
The easiest way to include this in modern javascript, assuming you are using something like and Babel, is to use an import
statement.
The library uses named exports for all modules.
To import the player module:
1import { ReactAudioPlayerInner, useAudioPlayer } from 'apm-react-audio-player';
See the audio tag documentation for detailed explanations of these attributes.
Prop | Type | Default | Notes |
---|---|---|---|
title | String | empty string | The title of the audio track |
audioSrc | String | empty string | The source URL of the audio file |
description | String | empty string | The description of the audio track |
audioPlayerRef | Object | empty object | A ref object for the audio player |
progressBarRef | Object | empty object | A ref object for the progress bar |
onLoadedMetadata | Function | --- | A function to handle the loadedmetadata event |
togglePlaying | Function | --- | A function to toggle the playing state |
isPlaying | Boolean | false | Whether the audio is currently playing |
isMuted | Boolean | false | Whether the audio is currently muted |
toggleMute | Function | --- | A function to toggle the mute state |
volumeCtrl | Function | --- | A function to control the volume |
currentTime | Number | null | The current time of the audio track |
duration | Number | null | The duration of the audio track |
rewindControl | Function | --- | A function to rewind the audio track |
forwardControl | Function | --- | A function to fast forward the audio track |
changePlayerCurrentTime | Function | --- | A function to change the current time of the audio track |
calculateTime | Function | --- | A function to calculate the time for the audio track |
formatCalculateTime | Function | --- | A function to format the calculated time |
playBtnClass | String | empty string | The CSS class for the play button |
customStyles | Object | --- | Custom styles for the audio player |
customHtml | JSX.Element | <></> | Custom HTML to be rendered inside the player |
1import { ReactAudioPlayerInner, useAudioPlayer } from 'apm-react-audio-player'; 2 3const Example = () => { 4 5 const audioPlayerRef = React.useRef(); 6 const progressBarRef = React.useRef(); 7 8 const { 9 onLoadedMetadata, 10 calculateTime, 11 volumeControl, 12 togglePlaying, 13 toggleMute, 14 isMuted, 15 changePlayerCurrentTime, 16 play, 17 isPlaying, 18 isFinishedPlaying, 19 currentTime, 20 duration, 21 formatCalculateTime, 22 rewindControl, 23 forwardControl 24 } = useAudioPlayer(audioPlayerRef, progressBarRef); 25 26 return ( 27 <ReactAudioPlayerInner 28 title={'MPR NEWS'} 29 audioSrc={'https://play.publicradio.org/web/o/minnesota/podcasts/art_hounds/2024/06/26/arthounds_art-hounds-franconia_20240626_64.mp3'} 30 description={'description'} 31 playBtnClass="player-btn player-btn-playpause js-player-play" 32 audioPlayerRef={audioPlayerRef} 33 progressBarRef={progressBarRef} 34 onLoadedMetadata={onLoadedMetadata} 35 play={play} 36 isPlaying={isPlaying} 37 togglePlaying={togglePlaying} 38 isMuted={isMuted} 39 currentTime={currentTime} 40 duration={duration} 41 isAudioFinished={isFinishedPlaying} 42 toggleMute={toggleMute} 43 volumeCtrl={volumeControl} 44 changePlayerCurrentTime={changePlayerCurrentTime} 45 rewindControl={rewindControl} 46 forwardControl={forwardControl} 47 calculateTime={calculateTime} 48 formatCalculateTime={formatCalculateTime} 49 customHtml={<></>} 50 /> 51 ) 52}
apm-react-audio-player
should always come with an updated version (ex. 1.0.17 to 1.0.18) in the package.json.git pull main
yarn run build
or npm run build
yarn publish
or npm publish
MIT © Phanx091
No vulnerabilities found.
No security vulnerabilities found.