xxxxxxxxxx
67
//make 2 black video behind wife and husband and use these videos to trigger mouseOver and mouseOut;
let wife;
let husband;
let bgLeft;
let bgRight;
let door;
// let playing = true;
function setup() {
createCanvas(600, 200);
door=createGraphics(200,200);
wife = createVideo("wife.mp4");
husband = createVideo("husband.mp4");
bgLeft = createVideo("black.mp4");
bgRight = createVideo("black.mp4");
door=createVideo("black.mp4");
bgLeft.size(600, 200);
bgRight.size(600, 200);
wife.size(300, 200);
husband.size(300, 200);
door.size(300,200);
wife.play();
husband.play();
bgLeft.mouseOver(husbandplay);
bgLeft.mouseOut(husbandpause);
bgRight.mouseOver(wifeplay);
bgRight.mouseOut(wifepause);
bgLeft.position(-350, 0);
bgRight.position(300, 0);
husband.position(290, 0);
wife.position(0, 0);
}
function draw() {
background(0);
// door.position(mouseX-100,0);
}
function wifeplay() {
console.log("Wplay");
wife.play();
}
function wifepause() {
wife.pause();
console.log("Wpause");
}
function husbandplay() {
console.log("Hplay");
husband.play();
}
function husbandpause() {
husband.pause();
console.log("Hpause");
}