dimanche 24 octobre 2021

I need my webpage to play random videos but the JS keeps repeating the same random video unless I refresh webpage

The HTML section loops but repeatedly plays the same randomly selected video selected by the JS. If I refresh the html it will play a different video. I would like it to choose a different random video after each delayms expires. I apologize, I am kind of new to programming and my terminology is off.

//HTML
{url:randvideo1, delayms:10000},

//video arrays found in JS

var videoArray1 = [
"v/video01.mp4",
"v/video02.mp4",
"v/video03.mp4",
"v/video04.mp4"
];

var randvideo1 = videoArray1[Math.floor(Math.random()*videoArray1.length)];



Aucun commentaire:

Enregistrer un commentaire