English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Das HTML <audio>-Element wird verwendet, um Audioinhalte in einem Dokument darzustellen. Das <audio>-Element kann mehrere Audioressourcen enthalten, die mit dem src-Attribut oder dem <source>-Element beschrieben werden; der Browser wählt den passendsten aus. Für Browser, die das <audio>-Element nicht unterstützen, kann das <audio>-Element auch als nicht erkanntes Inhalt in das Dokument eingefügt werden.
Wiedergabe von Tönen:
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Grundlagen-Tutorial-Website(oldtoolbag.com)</title> </head> <body> <audio controls> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3" type="audio/mpeg"> Ihr Browser unterstützt das Element audio nicht. </audio> </body> </html>Testen Sie es heraus ‹/›
IEFirefoxOperaChromeSafari
IE 9+、Firefox、Opera、Chrome und Safari unterstützen alle das <audio>-Tag.
Anmerkung: IE 8 oder frühere IE-Browser unterstützen das <audio>-Tag nicht.
<audio>-Tag definiert Töne, z.B. Musik oder andere Audiostreams.
Derzeit unterstützt das <audio>-Element3Art von Dateiformaten: MP3,WAV und OGG。
Browser | MP3 | Wav | Ogg |
---|---|---|---|
Internet Explorer | YES | NO | NO |
Chrome | YES | YES | YES |
Firefox | YES | YES | YES |
Safari | YES | YES | NO |
Opera | YES | YES | YES |
The <audio> tag is a part of HTML5New tag in
Note:<audio> and </ Any text between <audio> and
New :HTML5 New attribute in
Attribute | Value | Description |
---|---|---|
autoplayHTML5 | autoplay | If this attribute is present, the audio will play immediately after it is ready. |
controlsHTML5 | controls | If this attribute is present, the audio control (such as play, pause, etc.) is displayed to the user./Pause button). |
loopHTML5 | loop | If this attribute is present, the audio will restart playing every time it ends. |
mutedHTML5 | muted | If this attribute is present, the audio output is silent. |
preloadHTML5 | auto metadata none | Specifies whether the audio is loaded by default when the web page is loaded and how it is loaded. |
srcHTML5 | URL | Specifies the URL of the audio file. |
Support for <audio> Tag Global Attributes of HTML.
Support for <audio> Tag HTML Event Attributes.