getting audio to work on different browsers from a server

I have used HTML 5 audio tags like the following

<audio controls="control_2">
<source src="D:\HND_grrrrr\Year_2\RoyWebsite\Sounds\WAV\home_page_readout.wav"  type="audio/wav"/>
<source src="D:\HND_grrrrr\Year_2\RoyWebsite\Sounds\MP3\home_page_readout.mp3" type="audio/mp3"/>
<source src="D:\HND_grrrrr\Year_2\RoyWebsite\Sounds\ogg\home_page_readout.ogg" type="audio/ogg"/>


Now when i load the page when it is not uploaded to a server it manages to work on chrome and IE, however on other browsers the player appears, but there appears to be no file as nothing happens when i press play.

Now when i put the page to the server (I am using USB webserver V8.2) i get nothing no matter what browser the players dont even show. I have tried changing the links to relative and nothing and ive checked that all my files are there and they are. They work when I click on the actual file on the server so i dunno.

Any help would be appreciated thanks :)


To solve the second half of your question, and potentially the first, use relative paths to load the audio files. So if your web server loads the file from /var/www/website/index.php, places the files in a closer path, ie /var/www/website/sounds, and then load the files from ./sounds/FILE_NAME.EXTENSION

Need Your Help

Using Proguard with a library that uses Spring @Autowired by name

spring obfuscation proguard autowired

I'm using Proguard to obfuscate a library that has several @Autowired fields. The obfuscator is renaming those class fields (because they are private/internal to the class) and thus my bean is fai...

Scope of @Configuration Class in spring

java spring spring-mvc scope

We are having @Configuration class, but it doesn't contain any bean definition and as it is a legacy class written by someone i don't want to remove the @Configuration annotation even while there ...