<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>~`</title>
</head>
<style> video {
display: block;
margin-bottom: 1em;
} </style>
<br>
<video width="100%" height="100%" controls style="background:black">
<source src="CicadaBlack.mp4" type="video/mp4" />
</video>
</body>
</html>
<script>
var myvid = document.getElementById('myvideo');
var myvids = [
"CicadaBlack.mp4",
"CicadaWhite.mp4"
];
var activeVideo = 0;
myvid.addEventListener('ended', function(e) {
// update the new active video index
activeVideo = (++activeVideo) % myvids.length;
// update the video source and play
myvid.src = myvids[activeVideo];
myvid.play();
});
</script>
Comments