coderef

<audio>Baseline · Widely available

The &#x3C;audio> element plays sound such as audio effects or music, optionally with controls provided by the browser.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jul 29, 2015. Widely available since Jan 29, 2018.

Browser support

DesktopChrome
1–2Not supported
3+Supportedsince Sep 15, 2009
Current: 155
Edge
12+Supportedsince Jul 29, 2015
Current: 154
Firefox
1–3Not supported
3.5+Supportedsince Jun 30, 2009
Current: 157
Safari
1–3Not supported
3.1+Supportedsince Mar 18, 2008
Current: 27
MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155
Firefox Android
4+Supportedsince Mar 29, 2011
Current: 157
Safari iOS
1–2Not supported
3+Supportedsince Jun 17, 2009
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: HTMLAudioElement.

Feature detection

JS · check before using
if ("HTMLAudioElement" in globalThis && "Audio" in HTMLAudioElement.prototype) {
  // HTMLAudioElement.Audio is available
}

Sub-features

Support for each part of the feature (60). The overall table above shows when the whole feature works.

Show 40 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
HTMLMediaElement.error3123.53.11843
HTMLMediaElement.error_event31263.11863
HTMLMediaElement.load3123.53.11843
HTMLMediaElement.loadeddata_event3123.53.11843
HTMLMediaElement.loadedmetadata_event3123.53.11843
HTMLMediaElement.loadstart_event312641863
HTMLMediaElement.loop31211418143
HTMLMediaElement.muted3123.53.11843
HTMLMediaElement.networkState3123.53.11843
HTMLMediaElement.pause3123.53.11843
HTMLMediaElement.pause_event3123.53.11843
HTMLMediaElement.paused3123.53.11843
HTMLMediaElement.play3123.53.11843
HTMLMediaElement.play.returns_promise50175310505310
HTMLMediaElement.play_event3123.53.11843
HTMLMediaElement.playbackRate312203.118203
HTMLMediaElement.played312153.118153
HTMLMediaElement.playing_event3123.53.11843
HTMLMediaElement.preload512451845
HTMLMediaElement.progress_event31263.11863
HTMLMediaElement.ratechange_event3123.53.11843
HTMLMediaElement.readyState3123.53.11843
HTMLMediaElement.seekable31283.11883
HTMLMediaElement.seeked_event3123.53.11843
HTMLMediaElement.seeking3123.53.11843
HTMLMediaElement.seeking_event3123.53.11843
HTMLMediaElement.src3123.53.11843
HTMLMediaElement.stalled_event3123.53.11843
HTMLMediaElement.suspend_event3123.53.11843
HTMLMediaElement.timeupdate_event3123.53.11843
HTMLMediaElement.volumechange_event31263.11863
HTMLMediaElement.waiting_event31263.11863
audio3123.53.11843
audio.autoplay3123.53.118410
audio.controls3123.53.11843
audio.crossorigin33≤187410337910
audio.loop312113.118143
audio.muted15≤1811618146
audio.preload31243.11843
audio.src3123.53.11843