Video auto play

I’m having trouble stopping autoplay.

	    video = createCapture(VIDEO, function( stream ) {"video stream initialized");
            video.autoplay( false )	;
	    video.size(canvasW, canvasH);

Initially I had autoplay method set to false. This added video element attributes
autoplay=“false”. However, it did not work.
I added video.stop() is called. But doesn’t work.

Can anyone tells me how to stop autoplaying?


1 Like

you talk about the DOM element made by Processing p5


i think
-a- for the media there is a autoplay, but possibly not for the capture object
-b- also i doubt there is a .stop() / .play() for camera ( like we know for video )

if you just use the .hide(); it will not show up in HTML area,

and now try to do that what you want / enable disable show cam picture
from the p5.js side.

let capture;
let showcam = false;

function setup() {
  createCanvas(480, 480);
  capture = createCapture(VIDEO);

function draw() {
  if ( showcam ) image(capture, 0, 0);

function keyPressed () {
  showcam = ! showcam;