jeudi 26 mai 2022

How to make a random video play on a page without repeating?

I already made the video randomly play, but I need it not to repeat. Here is the code

function refreshbutton(){
var count = Math.floor(Math.random() * videos.length);
document.getElementsByTagName('source')[0].src = "./video/" + videos[count];video.load();}
var videos= ["video1.mp4","video2.mp4","video3.mp4"];



Aucun commentaire:

Enregistrer un commentaire