HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> video{ width:100%; height:330px } </style> </head> <body> <video controls> <source src="/hawk.mp4" type="video/mp4"> </video> <p><strong>Note</strong>: Let this video play till the end.</p> <script> var x = document.getElementsByTagName("video")[0]; function myFunction(){ alert("This video was finished"); } x.addEventListener("ended", myFunction); </script> </body> </html>
OUTPUT
×

Save as Private