xxxxxxxxxx
28
// https://discourse.processing.org/t/possible-memory-leak-with-video-texture-in-webgl-renderer/16088
let vid
const VIDEO_FILE_NAME = 'https://CommonDataStorage.GoogleApis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'
function preload() {
vid = createVideo([VIDEO_FILE_NAME], () => {
vid.size(480, 360)
})
}
function setup() {
createCanvas(800, 600, WEBGL)
}
function draw() {
background(40, 100, 100)
// image( vid, 10, 10 )
texture(vid)
box(480, 360, 20)
}
function mousePressed() {
vid.loop()
vid.hide()
}