How to detect end of video and redirect to another page using php for dynamic url?

I have,

<video autoplay>
    <source src=videos/poke.avi  type='video/mp4; codecs="theora, vorbis, avc1.42E01E, mp4a.40"' >
    <p>Your browser doesn’t support video.</p>

I want to do this,

video.onended =  {
  // do stuff (redirect to show content)

Thanks, but not wotking for me

Also I have id for item, $id I want this value on next page

So how to redirect with id?