HTML Audio/Video DOM propiedad readyState

❮ Referencia de DOM de audio/vídeo HTML

Ejemplo

Obtenga el estado de preparación actual del video:

var vid = document.getElementById("myVideo");
alert(vid.readyState);

Definición y uso

La propiedad readyState devuelve el estado listo actual del audio/video.

El estado listo indica si el audio/video está listo para reproducirse o no.

Nota: Esta propiedad es de solo lectura.


Compatibilidad con navegador

Los números de la tabla especifican la primera versión del navegador que es totalmente compatible con la propiedad.

Property
readyState Yes 9.0 3.5 Yes Yes

Sintaxis

audio|video.readyState

Valor devuelto

Type Description
Number Represents the ready state of the audio/video element:
  • 0 = HAVE_NOTHING - no information whether or not the audio/video is ready
  • 1 = HAVE_METADATA - metadata for the audio/video is ready
  • 2 = HAVE_CURRENT_DATA - data for the current playback position is available, but not enough data to play next frame/millisecond
  • 3 = HAVE_FUTURE_DATA - data for the current and at least the next frame is available
  • 4 = HAVE_ENOUGH_DATA - enough data available to start playing

❮ Referencia de DOM de audio/vídeo HTML