I have a div containing a video. The background of the div features a fake "play" button, which I've designed to use as the play button instead of Youtube's standard video "play" button. The video is initially set to "display:none"
.
I've deployed the code below so that when you click on the div, the div disappears and the video now displays and begins to play.
How can I edit the code so that when the video has finished playing, the video disappears and the div re-appears?
<div class="videodiv" this.style.cursor='pointer';
onclick="thevid=document.getElementById('thevideo'); thevid.style.display='block';
this.style.display='none'; "></div>
<div class="youtubevid" id="thevideo" style="display: none;"><object width="420"
height="160"><param name="movie" value="//www.youtube.com/v/vIdeoUrl?
hl=en_US&version=3&rel=0&controls=0&showinfo=0&autoplay=1">
</param><param name="allowFullScreen" value="true"></param><param
name="allowscriptaccess" value="always">
</param><embed src="//www.youtube.com/v/vIdeoUrl?
hl=en_US&version=3&rel=0&controls=0&showinfo=0&autoplay=1"
type="application/x-shockwave-flash" width="420" height="160"
allowscriptaccess="always" allowfullscreen="true"></embed></object></div>