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

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

예시

비디오의 오류 상태를 가져옵니다.

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

정의 및 사용

error 속성은 MediaError 개체를 반환합니다.

MediaError 개체에는 오디오/비디오의 오류 상태를 포함하는 코드 속성이 있습니다.


브라우저 지원

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

Property
error Not supported 9.0  Not supported Not supported Not supported

통사론

audio|video.error.code

반환 값

Type Description
Number The code property of the MediaError Object returns a number representing the error state of the audio/video:
  • 1 = MEDIA_ERR_ABORTED - fetching process aborted by user
  • 2 = MEDIA_ERR_NETWORK - error occurred when downloading
  • 3 = MEDIA_ERR_DECODE - error occurred when decoding
  • 4 = MEDIA_ERR_SRC_NOT_SUPPORTED - audio/video not supported

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