HTML Audio/Video DOM waitingEvento
Referencia del DOM de audio/video HTML
Ejemplo
Cuando el video necesita almacenar en búfer el siguiente fotograma antes de comenzar a reproducirse, muestra un mensaje emergente:
var vid = document.getElementById("myVideo");
vid.onwaiting = function() {
alert("Wait! I need to buffer the next frame");
};
vid.onwaiting = function() {
alert("Wait! I need to buffer the next frame");
};
Pruébalo »
Definición y uso
El evento waiting se dispara cuando el video se detiene porque necesita almacenar en búfer el siguiente fotograma.
Este evento se puede usar en el elemento <audio>, pero normalmente se usa en videos.
Compatibilidad del navegador
Los números en la tabla indican la primera versión del navegador que admite este evento.
| Evento | |||||
|---|---|---|---|---|---|
| waiting | Yes | 9.0 | Yes | Yes | Yes |
Sintaxis
En HTML:
<audio|video onwaiting="myScript">Pruébalo
En JavaScript:
audio|video.onwaiting=function(){myScript};Pruébalo
En JavaScript, usando el método addEventListener():
audio|video.addEventListener("waiting", myScript);Pruébalo
Nota:Internet Explorer 8 y versiones anteriores de IE no admitenaddEventListener()el método.
Detalles técnicos
| Etiquetas HTML compatibles: | <audio> y <video> |
|---|---|
| Objetos JavaScript compatibles: | Audio, Video |
Referencia del DOM de audio/video HTML Otras extensiones