Soy bastante nuevo en la codificación, estoy tratando de aplicar diferentes efectos de serious.js en diferentes matrices de videos, ni siquiera puedo hacer que el programa recorra los videos en la matriz
Aquí está el trabajo https://editor.p5js.org/ogierpaul/sketches/EeYFA5Vq_
let vid1= 'footb1.mp4'; let vid2= 'footb3.mp4'; let vid3= 'futball1.mp4'; b = []; b = [vid1,vid2,vid3]; function preload() { for (var j = 0; j < b.length; j++){ q = createVideo(b[j]); } } function setup() { createCanvas(640,480, WEBGL); } function draw() { background(220); }Parece que lo fundamental que está malinterpretando aquí es cómo agregar elementos a una matriz:
let vid1= 'footb1.mp4'; let vid2= 'footb3.mp4'; let vid3= 'futball1.mp4'; // I think you probably meant to declare q here not b let q = []; // previously: b = []; let b = [vid1,vid2,vid3]; function preload() { for (var j = 0; j < b.length; j++){ // as you create each new video you need to add it to the q array // you can do this using the push() function or using the index operator q[j] = createVideo(b[j]); // q.push(createVideo(b[j])); // this would also work // What you had would not work: q = createVideo(b[j]); // because it would replace the array initially stored in the variable q with // a single video } } function setup() { createCanvas(640,480, WEBGL); } function draw() { background(220); }