Mozilla’s official documentation for the #HTML5 #getUserMedia API for accessing cameras in #browsers; this has example code for things like front and back cameras. Apparently it’s deprecated, but I don’t know what alternatives exist.
on 02023-02-07how to use the #HTML5 #getUserMedia API for camera access in #browsers, step by step
on 02023-02-07the #HTML5 camera API #getUserMedia in #Firefox #browsers requires HTTPS (or localhost) since 02019; the about:config flag to allow otherwise is media.getusermedia.insecure.enabled
on 02023-02-07example code for #HTML5 camera API (#getUserMedia) to detect cameras (in this case for a #barcode #QR reader)
on 02023-02-07also in #Chromium #browsers, the #HTML5 camera API (#getUserMedia) can be blocked from a localhost port in chrome://settings/content/camera.
on 02023-02-07#Chromium #browsers allow access to the #HTML5 camera API #getUserMedia from localhost in JS, but not from file: URLs (even if you explicitly allow it yourself), though there's also chrome://flags/#unsafely-treat-insecure-origin-as-secure.
on 02023-02-07