Skip to content

Commit

Permalink
fix: can not trigger onAudioVolumeChange when play or pause audio wit…
Browse files Browse the repository at this point in the history
…h volume fade mode
  • Loading branch information
lijinke666 committed Jan 13, 2021
1 parent 016af3b commit 6b88d6c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1539,8 +1539,11 @@ export default class ReactJkMusicPlayer extends PureComponent {

onAudioVolumeChange = () => {
const { volume } = this.audio
const { currentVolumeFade } = this.state
if (currentVolumeFade !== VOLUME_FADE.NONE) {
const { currentVolumeFade, currentAudioVolume } = this.state
if (
currentVolumeFade !== VOLUME_FADE.NONE ||
currentAudioVolume === volume
) {
return
}
const volumeBarValue = this.getVolumeBarValue(volume)
Expand Down

0 comments on commit 6b88d6c

Please sign in to comment.