cancel
Showing results for 
Search instead for 
Did you mean: 

Embedded <audio/> in HTML page not working online.

FIXED
mpw
Newbie
Posts: 4
Registered: ‎05-08-2007

Embedded <audio/> in HTML page not working online.

Hello there

I've just added a simple audio file into a webpage hosted on my Plusnet webspace and while everything works well on my local machine but when I FTP (using Filezilla) the sound no longer works (on any browser). The total added code is

 

<iframe src="silence.mp3" allow="autoplay" id="audio" style="display:none"></iframe>

<audio id="player" autoplay>
<source src="duke.mp3" type="audio/mp3">
</audio>

 

The first part just allows Chrome to autoplay the next part.

Any thoughts on why it doesn't work when online would be gratefully received!

Thanks

Michael 

 

8 REPLIES 8
Anonymous
Not applicable

Re: Embedded <audio/> in HTML page not working online.

Hi @mpw Welcome to the Forums. It could be that the file can't be found so you might want to set the path of the mp3 file to

./duke.mp3

or provide it with a full path from the server root.

 

mpw
Newbie
Posts: 4
Registered: ‎05-08-2007

Re: Embedded <audio/> in HTML page not working online.

Hello there,

 

Thanks for the prompt reply!

I've checked and on both my local machine and also on my webspace that the files are just within the same single folder so I didn't think that I'd need a path.

Thanks

 

Michael

Anonymous
Not applicable

Re: Embedded <audio/> in HTML page not working online.

Fix

OK @mpw, but humour me if you will and prepend the file name with

./

Also remember that the server will no doubt be Unix so case is an issue as well, so duke.mp3 is not the same as Duke.mp3

mpw
Newbie
Posts: 4
Registered: ‎05-08-2007

Re: Embedded <audio/> in HTML page not working online.

Sir - you are a genius!!

Thank you so much for taking the time to help - I had upper case 'Duke' locally which worked fine but it was looking for lower case when it was online.

Thanks again for your assistance!

Regards

Michael

Anonymous
Not applicable

Re: Embedded <audio/> in HTML page not working online.

You are more than welcome @mpw, if you need any further assistance we're a friendly bunch here and only too willing to help.

7up
Community Veteran
Posts: 15,830
Thanks: 1,587
Fixes: 17
Registered: ‎01-08-2007

Re: Embedded <audio/> in HTML page not working online.


@mpw wrote:

the files are just within the same single folder so I didn't think that I'd need a path.


You'd be surprised! File paths are a total menace at times and being a simple / boring thing not many pay much attention to them but the simple / and ./ can mean two big differences.

I need a new signature... i'm bored of the old one!
ChrisWoods
Rising Star
Posts: 55
Thanks: 2
Fixes: 1
Registered: ‎11-08-2015

Re: Embedded <audio/> in HTML page not working online.

Just about all web servers run Linux, and Linux is case-sensitive. You could even have Duke.mp3 and duke.mp3 as different files. Only Windows is so carefree about filenames 🙂

VileReynard
Hero
Posts: 12,616
Thanks: 582
Fixes: 20
Registered: ‎01-09-2007

Re: Embedded <audio/> in HTML page not working online.

Due to its DOS origins.

"In The Beginning Was The Word, And The Word Was Aardvark."