Hi,
Ive tried a few things like onended in the video tags. I cant seem to get this to work. I have a 15 second video that autoplays on page load but I want it to disappear (preferably fade out) after its done playing. Anyone have any pointers? I've tried this

<div id="introvid">
<video class="xar_meplayer" src="index_htm_files/stage manager intro video.mp4" controls autoplay width = "100%" height="100%" onended="myFunction()"/>
</div>

function myFunction() {
var x = document.getElementById("introvid");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}


But it doesn't work. Any help is appreciated