Skip to content

Commit

Permalink
fix: invalid audio volume fadeIn #238
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Jan 5, 2021
1 parent dedd22c commit 1120e28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ const options = {

// Audio volume with fade in and fade out [type `{ fadeIn: number, fadeOut: number }` default `{ fadeIn: 0, fadeOut: 0 }`]
volumeFade: {
fadeIn: 500,
fadeOut: 500,
fadeIn: 1000,
fadeOut: 1000,
},

// Music is downloaded handle
Expand Down
6 changes: 1 addition & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1196,12 +1196,8 @@ export default class ReactJkMusicPlayer extends PureComponent {

adjustVolume(this.audio, this.state.currentAudioVolume, {
duration: fadeIn,
}).then(() => {
this.setState(
{ isAutoPlayWhenUserClicked: true },
this.loadAndPlayAudio,
)
})
this.setState({ isAutoPlayWhenUserClicked: true }, this.loadAndPlayAudio)
}
}

Expand Down

0 comments on commit 1120e28

Please sign in to comment.