Video - 10 seconds not played, hide it. If played, hide at end

Basically here is what I need done. I have a HTML5 video player. Right now I have code that after 20 seconds, the div that the video is in dissapears.

I’d like to have it do the following:

If the video is NOT played, then hide the div it is in after 10 seconds. If it is played, I would like the video to dissapear after it is done playing.

Here is the code I currently have which hides the div after 20 seconds or so:

<script type="text/javascript">
  $("div.mydiv").slideUp("slow", function () {

}, 22500);

Thank you very much for any help!!