1

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! :)

3 Answers3

1

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.

Shakti Phartiyal
  • 6,156
  • 3
  • 25
  • 46
0

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:)

Marco
  • 517
  • 6
  • 19
0

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
Community
  • 1
  • 1
Satish Saini
  • 2,880
  • 3
  • 24
  • 38
  • Do you have an online URL where I can check it? – Satish Saini Apr 19 '17 at 12:32
  • Ok, so there is an issue with accessing the mp3 file. When I open https://mitul106.000webhostapp.com/public_html/app5/components/GoodLife.mp3 it gives 404 error. So, please check the folder and path where you have all mp3 files. – Satish Saini Apr 19 '17 at 12:40
  • but the path is correct, and all the other files in there load so where would my issue lie? – Mitul Suchak Apr 19 '17 at 12:43
  • @MitulSuchak Try changing your path to: https://mitul106.000webhostapp.com/GoodLife.mp3 because I can see all files in main directory if I look at this URL: https://mitul106.000webhostapp.com/ – Satish Saini Apr 19 '17 at 13:17
  • Oh myyy, sorry for wasting your time on something so simple, I was being stupid aha. Thankyou so much works! – Mitul Suchak Apr 19 '17 at 14:23
  • @Mitul would you mind clicking up arrow to appreciate my time? ;) – Satish Saini Apr 20 '17 at 03:35