Reputation: 589
I know that the audio tag is new with HTML5. However, I wanted to see if it would work on a website I had developed for a Winston Churchill enthusiast about 10-15 years ago. The URL of the site is winstonisback.com. I developed the site in HTML4 with the DOCTYPE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
As an experiment, I added the following audio to its homepage.
<audio autoplay>
<source src="https://upload.wikimedia.org/wikimedia/wikipedia/commons/e/e8/Rule%2CBritannia%21_Instrumental.ogg">
</audio>
Surprisingly (to me at least) it works in Google Chrome, but not in Microsoft Edge. Why?!
Upvotes: 0
Views: 244
Reputation: 177715
It looks like Ogg Vorbis is coming in Edge 17: https://caniuse.com/vorbis (and https://developer.microsoft.com/en-us/microsoft-edge/platform/status/oggcontainer/ and https://developer.microsoft.com/en-us/microsoft-edge/platform/status/vorbisaudiocodec/)
Chrome doesn't implement different versions of HTML depending on the doctype, and neither does anyone else. I even have a citation for this broad claim: https://crbug.com/48976
The main exception is quirks mode (primarily concerning layout), which for some reason will never die.
The first working draft of HTML5 was published about a decade ago; browser vendors and standards authors work together to ensure that as much as possible remains compatible. This can occasionally break old pages, but a new feature has to clearly conflict with something that's in common use to warrant any sort of band-aid; this certainly wouldn't apply to new features like the audio element.
Upvotes: 1