HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> video{ width:100%; height:330px } </style> </head> <body> <video id="myVid" controls> <source src="/hawk.mp4" type="video/mp4"> </video> <button onclick="myAbort()">Abort this Video</button> <script> var x = document.getElementsByTagName("video")[0]; function myFunction(){ alert("Video aborted"); } function myAbort(){ document.getElementById("myVid").src = ""; } x.addEventListener("abort", myFunction); </script> </body> </html>
OUTPUT
×

Save as Private