Camera selected but no video feed appears
galenseilis opened this issue · comments
I've downloaded the repo, and uncompressed it. I then opened the index.html of jeelizPupillometry-master/demos/lightIntensity/ in Firefox or Chromium. I have the following version of Ubuntu:
$ cat /etc/issue
Ubuntu 20.10 \n \l
After opening index.html, nothing happens beyond the HTML page being displayed in the browser. I click on 'Experiment' and a popup asks if the browser can access my camera. On Firefox it gives me a dropdown among the available cameras, and on Chromium it defaults to using the built-in camera on my laptop.
Regardless of the choice of the aforementioned browser, accepting access turns a light on my camera (regardless of whether I select the built-in or external webcam). A blinking red icon also appears on the browser indicating access to my camera. However, I do not see any video feed come up if I return to the Debug view.
Opening the console of the browser while in this camera-selected state, I see two messages:
Message one:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at /path/to/jeelizPupillometry-master/dist/jeelizPupillometryNNC.json. (Reason: CORS request not http).
Message two:
Uncaught SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
P /path/to/jeelizPupillometry-master/dist/jeelizPupillometry.js:149
onreadystatechange /path/to/jeelizPupillometry-master/dist/jeelizPupillometry.js:19
Associated with message two is the following:
jeelizPupillometry.js:149:83
I'd love to try your software, but I require some assistance in configuring it to run on Ubuntu with a regular webcam.
The error is explicit: the JSON is not valid, probably because a CORS issue.
This is an issue with your static HTTP server used to host the library.
You can check the JSON file using Chrome developers tools.
Indeed, you need to host the library using a static HTTPS server, not launch the file directly.
This issue is a duplicate of #2