HTML -Autoplay- Attribut
Definition und Verwendung
Das
autoplay
Attribut ist ein boolesches Attribut.
Wenn vorhanden, beginnt die Audio-/Videowiedergabe automatisch, sobald dies ohne Unterbrechung möglich ist.
Gilt für
Das
autoplay
Attribut kann für die folgenden Elemente verwendet werden:
Elemente | Attribut |
---|---|
<Audio> | automatisches Abspielen |
<video> | automatisches Abspielen |
Beispiele
Beispiel
Eine Audiodatei, die automatisch abgespielt wird:
<audio controls autoplay>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Beispiel
Ein Video, das automatisch abgespielt wird:
<video controls autoplay>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
Browser-Unterstützung
Das autoplay
Attribut hat die folgende Browserunterstützung für jedes Element:
Element | |||||
---|---|---|---|---|---|
audio | 4.0 | 9.0 | 3.5 | 4.0 | 10.5 |
video | 4.0 | 9.0 | 3.5 | 4.0 | 10.5 |