Reputation: 23
Hi ive done a project for university of creating a web application. I added in an audioplayer, and it worked perfectly fine locally, but when I added it to my web app online i get the error:
GET https://mitul106.000webhostapp.com/app5/public_html/app5/components/G-Eazy%…20Kehlani%20-%20Good%20Life.mp3/G-Eazy%20&%20Kehlani%20-%20Good%20Life.mp3 404 ()
Uncaught (in promise) DOMException: Failed to load because no supported source was found. music:1
The directory path is correct im not too sure what else the issue could be. If you need any more of me feel free to ask and thankyou in advance! :)
Upvotes: 1
Views: 447
Reputation: 2968
As per standards, src attribute should contain a valid URL. Since space characters are not allowed in URLs, you have to encode them.
You can write:
src="Sound%20Awesome.mp3"
but NOT
src="My-Sound%20Awesome.mp3"
Check your Sound File name - It has "-" in it.
Path to the audio file is not correct in your case. Try changing it to:
https://mitul106.000webhostapp.com/GoodLife.mp3
Upvotes: 0
Reputation: 527
Spaces are not supported in file/directory names when using them in websites.
So just remove the spaces or replace them by a underscore(_)
I hope I can help:)
Upvotes: 0
Reputation: 6254
You need to remove all spaces from the file names and replace then with underscores (_) for working with them on the web.
So if your mp3 file is Teri Meri Kahani.mp3 rename it to teri_meri_kahani.mp3 .
Also remove spaces from all the directories if any in which you store songs online.
Upvotes: 1