HTML Audio/Video DOM automatisch afspelen Eigenschap
❮ HTML Audio/Video DOM-referentie
Voorbeeld
Automatisch afspelen inschakelen en video opnieuw laden:
var vid = document.getElementById("myVideo");
vid.autoplay = true;
vid.load();
Definitie en gebruik
De eigenschap autoplay bepaalt of retourneert of de audio/video moet beginnen met afspelen zodra deze is geladen.
Browserondersteuning
De getallen in de tabel geven de eerste browserversie aan die de eigenschap volledig ondersteunt.
Property | |||||
---|---|---|---|---|---|
autoplay | Yes | 9.0 | 3.5 | Yes | Yes |
Syntaxis
Retourneer de autoplay-eigenschap:
audio|video.autoplay
Stel de autoplay-eigenschap in:
audio|video.autoplay=true|false
Eigendomswaarden
Value | Description |
---|---|
true | Indicates that the audio/video should start playing as soon as it is loaded |
false | Default. Indicates that the audio/video should NOT start playing as soon as it is loaded |
Technische details
Winstwaarde: | Een Booleaans. Ofwel waar of onwaar |
---|---|
Standaardwaarde: | vals |
❮ HTML Audio/Video DOM-referentie