English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Die error-Eigenschaft ist der zuletzt aufgetretene MediaError-Objekt; wenn es keine Fehler gibt, ist es null. Wenn das Projekt den error-Event erhält, kann es detaillierte Informationen darüber erhalten, was passiert ist, wenn dieses Objekt überprüft wird.
HTML Audio/Video DOM Reference Manual
Video-Fehlerstatus erhalten:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML-Audio/Video error-Eigenschaft verwenden-Grund教程(oldtoolbag.com)</<title> </<head> <body> <button onclick="getError()" type="button">Videofehlerstatus erhalten</button> <br> <video id="video1" controls="controls" autoplay="autoplay"> <source src="movie_no_exist.mp4" type="video/mp4"> <source src="movie_no_exist.ogg" type="video/ogg"> Ihr Browser unterstützt keine HTML5 video Etikett. </video> <script> myVid=document.getElementById("video1); function getError() { alert(myVid.error.code); } </script> </body> </html>Test to see ‹/›
The error attribute returns the MediaError object.
The code property of the MediaError object contains audio/Video error state.
IEFirefoxOperaChromeSafari
Only Internet Explorer 9 Supports the error attribute.
audio|video.error.code
Type | Description |
---|---|
Number | The code property of the MediaError object returns a numeric value that indicates the audio/Video error state:
|