목차
- suspend 예제
- suspend 정의
- suspend 구문
suspend 예제
※ 브라우저가 의도적으로 미디어 데이터 안 가져올 때 함수 실행.
<video onsuspend="homzzang()">
suspend 정의
브라우저가 의도적으로 미디어 데이터 안 가져올 때 이벤트 발생.
1.
- 이 이벤트는 미디어 로드가 일시 중단될 때 발생.
- 이 이벤트는 다운 완료 또는 어떤 이유로 일시 중지 시 발생 가능.
2. 미디어 로드 방해 발생 시 발생하는 이벤트 종류
3.
4
IE9 이상 주요 최신 브라우저 모두 지원.
5.
MDN suspend 이벤트 예제 보기
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/suspend_event
suspend 구문
HTML 속성 방식
<element onsuspend="myScript">
JS 속성 방식
object.onsuspend = function(){myScript};
JS 메서드 방식
object.addEventListener("suspend", myScript);
PS. addEventListener() 메서드는 IE8 이상 지원.