HTML Audio/Video DOM readyState Property

❮ Riferimento DOM audio/video HTML

Esempio

Ottieni lo stato pronto attuale del video:

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

Definizione e utilizzo

La proprietà readyState restituisce lo stato pronto corrente dell'audio/video.

Lo stato pronto indica se l'audio/video è pronto per la riproduzione o meno.

Nota: questa proprietà è di sola lettura.


Supporto browser

I numeri nella tabella specificano la prima versione del browser che supporta completamente la proprietà.

Property
readyState Yes 9.0 3.5 Yes Yes

Sintassi

audio|video.readyState

Valore di ritorno

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

❮ Riferimento DOM audio/video HTML