HTML5 동영상 플레이어의 대체 메커니즘을 구현 중입니다. swfobject Flash Player로 대체 할 방법이 있지만 문제가 발생하면 어떻게 감지해야합니까?HTML5 비디오는 언제 Flash Player로 대체되어야합니까?
즉, 던져 질 수있는 다음 오류 이벤트 목록을 사용하면 플래시 플레이어 교체를 트리거해야하는 오류 이벤트 목록을 사용합니다. 또는 오류가 발생하면 대체해야합니까?
또한 onError 핸들러는 어디에서 호출해야합니까? 나는 비디오 태그에 대해 생각하고 있지만 확실히하고 싶습니다. 귀하의지도가 많이 감사드립니다. 감사.
function failed(e) {
// video playback failed - show a message saying why
switch (e.target.error.code) {
case e.target.error.MEDIA_ERR_ABORTED:
alert('You aborted the video playback.');
break;
case e.target.error.MEDIA_ERR_NETWORK:
alert('A network error caused the video download to fail part-way.');
break;
case e.target.error.MEDIA_ERR_DECODE:
alert('The video playback was aborted due to a corruption problem or because the video used features your browser did not support.');
break;
case e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:
alert('The video could not be loaded, either because the server or network failed or because the format is not supported.');
break;
default:
alert('An unknown error occurred.');
break;
}
}