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
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/audioserver?
it's just html page without a server
If you don’t have a server where’s the music being stored?
the data is given by youtube data api v3
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
nope
i wanna get the mp3 audio src
then i can set the src to my audio element
Again, doing that is illegal. Don’t do it
or I can download the clicked song and then set the src
👆
still?
Yes, still
ah, then what can i do😔
No matter how you steal the music it’s still theft
International music copyright is complex. Best to consult with a lawyer
many discord bots use yt to stream music 😕
also my site isn't public
“Other people break the law, why can’t I?” Isn’t a good excuse
dude, i'll delete my project as soon as my school exhibition is over
It doesn’t matter if you’re site is “public” or not. You. Don’t. Have. The. Rights. To. The. Songs
:(
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
is it bad to get the mp3 url instead of streaming?
YT isn’t the only option
hmmm
hey @cvanilla13eck, If I download songs from the internet, and then use them to play on my website, is it legal?
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