xxxxxxxxxx
35
// press any key to start the video
function preload() {
font = loadFont('CommitMono VariableFont.ttf')
video = createVideo('bbb_trimmed_muted_resized.mp4')
}
function setup() {
video.hide()
video.loop()
createCanvas(640, 360)
label = 'filter(BLUR, useWebGL=false)'
textSize(30)
textFont(font)
lblWidth = textWidth(label) + 20
lblHeight = textAscent() + 20
}
function draw() {
clear()
image(video, 0, 0)
filter(BLUR, 5)
fill('WHITE')
noStroke()
rect(0, height - lblHeight, lblWidth, lblHeight)
fill('BLACK')
text(label, 10, height - 10)
}
function keyPressed() {
video.play()
}