Double Click to close a Video and have it collapse

I have code for it to collapse after it ends. I just want it to close is someone double clicks it. Do you by chance know how to do that?