Double Click to close a Video and have it collapse

I have written some code to have a video collapse on .onEnded but I would also like it to collapse when someone double clicks on it. Here is the code I have:
$w . onReady ( async function () { console . log ( “Page is ready!” );
$w ( “#Introvideo” ). onDblClick (( event ) => {
let targetID = event . target . id ; // “myVideoPlayer”
console . log ( "Playtime of " + targetID + “has been ended!” )
$w ( “#Introvideo” ). hide ( ‘fade’ ); $w ( “#Introvideo” ). collapse ();
});
});

$w("#Introvideo").hide("fade").then(() => $w("#Introvideo").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?

@bobbiannesflowers Put the video player in a box, and assign the dblClick event listener to the box.