Week 09
Video and Sound
Load Images
var img;
var k = 2;
function setup() {
createCanvas(720, 400);
img = loadImage('images/car' + k + '.jpg');
console.log(k);
}
function draw() {
image(img, 0, 0, width, height);
}Preload()
var img;
var k = 3;
function preload(){
img = loadImage('images/car' + k + '.jpg');
}
function setup() {
createCanvas(720, 400);
}
function draw() {
image(img, 0, 0, width, height);
}
createCapture()
Simply ADD Video as an DOM element
You can add your video DOM on to the Canvas with image();
tint()
hide()
Http VS Https
Simple Snapshot Function
Snapshot in an Array
Other Example
Audio
AudioIn()
Simple Music Player
Face Tracker
Assignment: Either Video OR Sound
Last updated