Video stream from Webcam not showing up

Hi, I am trying to stream the webcam video on the HTML page, using the latest Chrome browser. The stream is not showing up, I am getting the following error in the chrome console

Not allowed to load local resource: blob:null/868aad42-ffd4-4e97-b4fd-ab9a9ffe18f7

I am trying the implement a very simple example, wondering what is wrong. Here is the JS sketch file code,

`(function () { "use strict";

var s = function (p) {

      p.setup = function () {
        p.canvas = p.createCanvas(640, 480, p.WEBGL);
        p.canvas.id('p5Canvas');
        p.background(51);
        p.video = p.createCapture(p.VIDEO);
        p.video.size(640, 480);
        p.video.id('p5Video');
        p.video.removeAttribute('crossorigin');
    };

};

var myP5 = new p5(s, 'videoContainer');

}());`

Here is my HTML file code,

<div id="outputContainer">
    <div id="videoContainer" width="960" height="720" style="display: inline-block;"></div>
    <div id="sketchContainer"></div>
</div>

Any help shall be deeply appreciated in this regard.

PS - The 'code' and 'quote' formatting arguments in this post are acting weird, not sure why.

Sign In or Register to comment.