HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> video{ width:100%; height:330px } </style> </head> <body> <p>Refresh this page and immediately go to any other tabs in your browser. Then the 'stalled' event will be triggered within 5 seconds.</p> <video controls> <source src="blabla.mp4" type="video/mp4"> </video> <script> var x = document.getElementsByTagName("video")[0]; function myFunction(){ alert("Unable to fetch the media data"); } x.addEventListener("stalled", myFunction); </script> <p><strong>Note</strong> : We don't have blabla.mp4.</p> </body> </html>
OUTPUT
×

Save as Private