Snap
Snap copied to clipboard
Snap! can't access the camera in the latest Chrome
Version 109.0.5414.75 (Official Build) (64-bit) Windows 10
Works fine in Edge and FireFox. And worked fine recently in Chrome (and yes it does have permission)
Just clicking the camera icon after opening Snap! 8.0 reproduces the problem.
Also Chrome can access the camera and produce a costume using custom JavaScript.
Mine works in Chrome (Win11) Version 109.0.5414.75 (Official Build) (64-bit)
On Sat, 21 Jan 2023 at 17:54, Ken Kahn @.***> wrote:
[image: image] https://user-images.githubusercontent.com/2138696/213880225-f8378080-0e4b-47f5-acf0-a72e5c66dd7b.png
Version 109.0.5414.75 (Official Build) (64-bit) Windows 10
Works fine in Edge and FireFox. And worked fine recently in Chrome (and yes it does have permission)
Just clicking the camera icon after opening Snap! 8.0 reproduces the problem.
— Reply to this email directly, view it on GitHub https://github.com/jmoenig/Snap/issues/3168, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR7RNC3FBFNQVS4DKULIR3WTQPD5ANCNFSM6AAAAAAUCQLFRI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Restarting Chrome fixed the problem. But note that Snap! is still doing something wrong here in that while Snap! couldn't access the camera using its normal JavaScript, custom JavaScript was able to access the camera.
Hi Ken, I've also been noticing various issues on different browsers recently with accessing the camera, with varying degrees of reproducibility. Since I need to educate myself - again - on the nitty gritty details could you perhaps share with me the custom JS script that's able to access the camera? Maybe we can follow its pattern in Snap more closely to ensure more reliable access. Thank you!
Here's a simplified version I what I'm using that worked when I tested it just now
let constraints = {video: true,
audio: false};
let video = document.createElement('video');
document.body.appendChild(video);
let stream = await navigator.mediaDevices.getUserMedia(constraints);
video.srcObject = stream;
video.play();
video.setAttribute('autoplay', '');
video.setAttribute('playsinline', '');
thanks, Ken, I appreciate it. Will try some experiments with this!
Happy to help.
I see that if navigator.mediaDevices
is not defined there is a fallback to
navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.msGetUserMedia
No idea if that is still a concern.