Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AudioInfo has ID field ? #73

Closed
eeeeeeeeeee555 opened this issue Nov 29, 2019 · 3 comments
Closed

AudioInfo has ID field ? #73

eeeeeeeeeee555 opened this issue Nov 29, 2019 · 3 comments

Comments

@eeeeeeeeeee555
Copy link

eeeeeeeeeee555 commented Nov 29, 2019

Let me show you my intent:
I add a song named "ABC" with ID: 123 to audioLists. Then when I pause that song in music player, the state song with same ID will change to paused as well

//audio pause handle

  onAudioPause(audioInfo) {
       const currenSong = findSong(audioInfo.ID)
       currentSong.playing = false
       setCurrentSong(currentSong)
  },

How to do that ? Thank you ! I can find the corresponding song by name but I am assuming there are same name songs

@lijinke666
Copy link
Owner

hi~ I plan tomorrow release a new version with custom fields in audioInfo

@eeeeeeeeeee555
Copy link
Author

eeeeeeeeeee555 commented Dec 1, 2019

hi~ I plan tomorrow release a new version with custom fields in audioInfo

Awesome. I am looking forward it :)

@lijinke666
Copy link
Owner

lijinke666 commented Dec 2, 2019

AudioInfo contains the custom field for audio lists now, upgrade version 4.6.1

function onAudioPause(audioInfo) {
  console.log(audioInfo.id) // 1
  console.log(audioInfo.test) // 2
}
<ReactJkMusicPlayer audioLists={[{id:1, test: 2, ...}]}  onAudioPause={onAudioPause}/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants