English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML-Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML Audio/video-DOM readyState-Eigenschaft

readyState-Eigenschaft gibt Audio zurück/The current ready state of the video.

 HTML Audio/Video DOM Reference Manual

Online-Beispiel

Den Zustand der Bereitstellung des Videos erhalten:

!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML-Audio/Verwendung der video-readyState-Eigenschaft-Grundlegende Anleitung(oldtoolbag.com)</title>
</head>
<body>
<button onclick="getReadyState()" type="button">Den Zustand der Bereitstellung des Videos erhalten</button>
<br> 
<video id="video1" controls="controls">
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  Ihr Browser unterstützt keine HTML5 video-Tag.
</video>
<script>
myVid=document.getElementById("video1");
function getReadyState()
{ 
  alert(myVid.readyState);
} 
</script>  
</body>
</html>
Testen Sie es heraus ‹/›

Definition und Verwendung

readyState-Eigenschaft gibt den Audio-Status zurück/The current ready state of the video.
Ready state indicates audio/Whether the video is ready to play.
Note: This property is read-only.

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the readyState property.

Note:Internet Explorer 8 and earlier versions do not support this property.

Syntax

audio|video.readyState

Return value

TypeDescription
NumberRepresents audio/Video (audio/Ready state of the video element (
  • 0 = HAVE_NOTHING - No information about audio/Information about whether the video is ready

  • 1 = HAVE_METADATA - About audio/Metadata of the video is ready

  • 2 = HAVE_CURRENT_DATA - Data about the current playback position is available, but not enough data to play the next frame/Milliseconds

  • 3 = HAVE_FUTURE_DATA - The current and at least the next frame's data is available

  • 4 = HAVE_ENOUGH_DATA - There is enough data available to start playing

 HTML Audio/Video DOM Reference Manual