DEV Community

Discussion on: How to create a progressive audio player with React hooks

Collapse
 
nicomartin profile image
Nico Martin

Hi Aderman

Sure. Behind it you have a native HTML Audio Element. So it works with every format that is supported by your browser.

Collapse
 
adermanjr profile image
Aderman Jr.

Good!

And how i can pass a json list with mp3 and implement previous and next actions? And change automaticaly the next song when one finish?

Thread Thread
 
nicomartin profile image
Nico Martin

You could either load the file via an http request or you could import it at build time (I guess you're using Webpack?).
You would then need to write your own logic what should happen when the song finished. But you could use the onEndedcallback to change the audio file.

Thread Thread
 
adermanjr profile image
Aderman Jr.

Ok. Thank you, man!