How could I do that, with each access to the site, a different video appeared? I understand that there are codes that alter the background with images as below:
<script type="text/javascript">
window.onload = function(){
var imgr = Math.round(Math.random()*4);
var imgsrc = [
'imagem1.jpg',
'imagem2.jpg',
'imagem3.jpg'
];
document.getElementById('eximg').src = imgsrc[imgr];
}
</script>
<img id="eximg"/>
But how would I apply to videos?
<video playsinline="playsinline" autoplay="autoplay" muted="muted" loop="loop">
<source src="mp4/fundo.mp4" type="video/mp4">
</video>
PS: I ask that only people who understand the subject vote to close or indicate as a duplicate, because one case is an image and the other is a video and if they do, please give me an example, since many people, like this like me, do not have much experience in Jquery or Javascript and see this as differentiated cases.