Bug 39422 - <audio> does not play mp3 file if it doesn't have an extension
Summary: <audio> does not play mp3 file if it doesn't have an extension
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.6
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-20 05:53 PDT by Jaka Jančar
Modified: 2015-02-08 15:22 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaka Jančar 2010-05-20 05:53:03 PDT
new Audio('foo') doesn't work. If the file is renamed to foo.mp3, it does.

I've also tried using <source> and setting type to 'audio/mpeg', but it still doesn't work.
Comment 1 Andy Bajka 2015-02-08 07:50:23 PST
I can confirm this bug. It occurs in Safari OS X and iOS using the latest versions as of February 2015. Both Firefox and Chrome will play the .MP3 file even if the source file has no extension.

Example where "audio" is a valid .MP3 file.

<audio controls>
<source src="http://www.example.com/audio" type="audio/mpeg">
</audio>
Comment 2 Jer Noble 2015-02-08 15:22:27 PST
Jaka & Andy, what is the extensionless file being served as? I suspect that, in your example, it's being served as 'text/html'.

When I do the same experiment with a server configured to give the correct MIME type in the HTTP response, the content plays back as expected.