0

I'm looking for a way to place a php function after an html5 video ends, the code below doesn't seem to work.

There's an image centered on the video when the page is loaded, I'd like the image to reappear right after the video ends.

<video src="video.ogv" id="myVideo">
</video>

<script type='text/javascript'>

document.getElementById('myVideo').addEventListener('ended',myHandler,false);
function myHandler(e) {
// What you want to do after the event
//I would like to put a php function here, but it doesn't work
}
</script>
Nid Moass
  • 19
  • 5
  • I dont think that is possible and could create security risks. Maybe you could use a sleep timer and flush but better would be to use ajax and communicate with the server while or after the movie is done. Check out jquery ajax. – Nitin May 19 '16 at 20:10
  • Could you help with coding ajax? – Nid Moass May 19 '16 at 20:12
  • Here is an example of how to do it. If you run into problems post the problem here and i would be happy to help http://stackoverflow.com/questions/9436534/ajax-tutorial-for-post-and-get – Nitin May 19 '16 at 20:23

0 Answers0