Debug with Editor

Which Sketch? I have so many now.

Or like here:

video runs on your canvas

function preload() {
  // preload() runs once
  c3 = loadImage('ps5.jpg')
  ps5video = createVideo('PS5 Trailer.mp4');
}

function setup() {
  createCanvas(720, 350);

  ps5video.position(width - 275, 90);
  ps5video.loop();

  c3.resize(115, 0);

  for (let i = 0; i < width / 10; i++) {
    particles.push(new Particle());
  }
}

function draw() {

Yes that is what I was after the blessed position. I thought I would have to do another canvass

And you see the video now?

Yes it plays now. It would be nice if I could show the preview before it starts though. The position was what I was struggling with so progress.

Yes works. I need to write code to trigger when mouse pressed in that location and stops when also pressed.

This


let playMy = true; // false respectively

function togglePlay() {
  if (playMy) {
    ps5video.pause();
    playMy = false;
  } else {
    ps5video.loop();
    playMy = true;
  }
}

and register the function in setup()

ps5video.mouseClicked(togglePlay);

(you can say ps5video.pause() or ps5video.loop in setup() afaik; set flag playMy accordingly initially)

I see. No need for any buttons.

In this case not, no

Ok. How do I call other sketches in my other files?

should be easy, but I don’t know

please search the forum here

Sure. I will do. I will search for the other videos now. Have a good weekend what is left. You have been great help !!

1 Like

background video:

background(ps5video.get());

I tried just a background image. I will give this a try. Interesting it needed a .get()

That worked :slight_smile: Thanks again. Plan to try and stitch together each screen now.

1 Like