HTML 오디오/비디오 DOM readyState 속성

❮ HTML 오디오/비디오 DOM 참조

예시

비디오의 현재 준비 상태를 가져옵니다.

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

정의 및 사용

readyState 속성은 오디오/비디오의 현재 준비 상태를 반환합니다.

준비 상태는 오디오/비디오를 재생할 준비가 되었는지 여부를 나타냅니다.

참고: 이 속성은 읽기 전용입니다.


브라우저 지원

표의 숫자는 속성을 완전히 지원하는 첫 번째 브라우저 버전을 지정합니다.

Property
readyState Yes 9.0 3.5 Yes Yes

통사론

audio|video.readyState

반환 값

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

❮ HTML 오디오/비디오 DOM 참조