Which API to use to use play music in our html page?

So I've created a webpage for music. If I click any title from the results (shown in img), it should play the song which's title was clicked. And I'm confused what to do now. whether I should use any API or not. Please help me
23 Replies
13eck
13eck2y ago
If you have the music on your server (and the rights to play it) it should be as easy as creating an audio element and when a user clicks a song it sets the src off the audio element to the song https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio
Melodium
MelodiumOP2y ago
server? it's just html page without a server
13eck
13eck2y ago
If you don’t have a server where’s the music being stored?
Melodium
MelodiumOP2y ago
the data is given by youtube data api v3
13eck
13eck2y ago
Streaming music from YT is against the law. You need to have the rights to the music to play it. Sorry, but we can’t help with illegal activity here It’s also against YT’s TOS
Melodium
MelodiumOP2y ago
nope i wanna get the mp3 audio src then i can set the src to my audio element
13eck
13eck2y ago
Again, doing that is illegal. Don’t do it
Melodium
MelodiumOP2y ago
or I can download the clicked song and then set the src
13eck
13eck2y ago
👆
Melodium
MelodiumOP2y ago
still?
13eck
13eck2y ago
Yes, still
Melodium
MelodiumOP2y ago
ah, then what can i do😔
13eck
13eck2y ago
No matter how you steal the music it’s still theft International music copyright is complex. Best to consult with a lawyer
Melodium
MelodiumOP2y ago
many discord bots use yt to stream music 😕 also my site isn't public
13eck
13eck2y ago
“Other people break the law, why can’t I?” Isn’t a good excuse
Melodium
MelodiumOP2y ago
dude, i'll delete my project as soon as my school exhibition is over
13eck
13eck2y ago
It doesn’t matter if you’re site is “public” or not. You. Don’t. Have. The. Rights. To. The. Songs
Melodium
MelodiumOP2y ago
:(
13eck
13eck2y ago
Breaking a service’s ToS isn’t the best way to show you can be a good programmer, FYI If you want to stream music find some copyright free music or a service that explicitly allows for online streaming
Melodium
MelodiumOP2y ago
is it bad to get the mp3 url instead of streaming?
13eck
13eck2y ago
YT isn’t the only option
Melodium
MelodiumOP2y ago
hmmm hey @cvanilla13eck, If I download songs from the internet, and then use them to play on my website, is it legal?
13eck
13eck2y ago
Regardless of where you get the music from it’s illegal to stream it online if you don’t have the rights. Online stealing streaming, even for “personal use” is considered a public broadcast as far as copyright law is concerned
Want results from more Discord servers?
Add your server