getUserMedia not allowed - access to webcam

HI ALL! :slight_smile:

i’ve a problem using getUserMedia, trying to access webcam:

var constraints = {
audio: false,
video: { width: 640, height: 640, frameRate: { ideal: 40, max: 60 } }
.then(function(stream) {
.catch(function(err) {
console.log( + ": " + err.message, err);

it throws exception, the same code on Codepen works.

suggestions? thanks!

Try taking a look at the exception that it throws. It might turn out to be a problem that you can easily correct.

If you have trouble understanding the exception, you could try posting it here, in case someone else knows what it means.

@spleennooname could you also post the working codepen example as well?

sure, here: (i’m trying to bind the webcam texture in a-video component )

thx for feedback! :slight_smile:

When I run it looking at developer tools (F12 in Chrome), the console says there is an error on line 42 of index.html. Looking at that line, there is a subtle closure error. “this” inside of the onloadedmetadata callback is NOT the same as “this” inside of the done callback. Therefore does not exist in the onloadedmetadata callback, and fails because is undefined.

This remix has that fixed:!/shocking-whimsey

I’m not clear if that is the specific error you’re referring to, and it doesn’t reproduce all of the codepen, but I suspect that is because the shaders, etc. are missing.


@danroot thank u very much!! :wink:

@spleennooname I wonder if there is a non-3d view (normal website view)

Hi, I don’t think OP needs help anymore

Also, please don’t bump old posts!


thanks, you helped a lot

David via Glitch Support <>, 26 Oca 2021 Sal, 16:31 tarihinde şunu yazdı: