How can I make a video play and then disappear when my Wix page is clicked on?

Of course you have to put it into the onReady-section…like…

$w.onReady(function() {console.log("Page is ready!");
    $w("#myVideoPlayer").onEnded((event) => {
        let targetID = event.target.id; // "myVideoPlayer"
        console.log("Playtime of "+targetID+"has been ended!")
    });
});