react-use-audio-player
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -56,2 +56,6 @@ "use strict"; | ||
}, | ||
onend: () => { | ||
setStopped(true); | ||
setPlaying(false); | ||
}, | ||
onpause: () => void setPlaying(false), | ||
@@ -111,6 +115,6 @@ onstop: () => { | ||
exports.useAudioPosition = () => { | ||
const { player, playing } = react_1.useContext(AudioPlayerContext); | ||
const { player, playing, stopped } = react_1.useContext(AudioPlayerContext); | ||
const [position, setPosition] = react_1.useState(0); | ||
const [duration, setDuration] = react_1.useState(0); | ||
// sets position and duration on player initialization | ||
// sets position and duration on player initialization and when the audio is stopped | ||
react_1.useEffect(() => { | ||
@@ -121,3 +125,3 @@ if (player) { | ||
} | ||
}, [player]); | ||
}, [player, stopped]); | ||
// updates position on a one second loop | ||
@@ -124,0 +128,0 @@ react_1.useEffect(() => { |
{ | ||
"name": "react-use-audio-player", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "React hook for building custom audio playback controls", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
17443
169
0