Accessing Your Webcam in HTML5


#42

I’ve gotten this to work as a single html file, but when I then take that file and make it as the target of another file’s frameset, it doesn’t work even though loading the frameset page causes my computer to ask for permission to access my camera. If I right click and choose to view the frame in its own tab, it loads and works.

The idea is to have a split browser screen where you have me in one part, and the text I’m reading in the other part. Having it all in one window is easier than having the video in one window and the text in another and manually arranging it on my screen.
Any ideas?


#43

Is the domain for both the page loading the frame and the content of the frame the same?


#44

Yes. They’re all local files.

Videobox.html is the file that works fine on its own, but not in this context. I just get the grey box. ![frameset%20example|690x405](upload://4dAQvtX9kGjBMNYJftVp7mt5EvB.png)

#45


#46

Try uploading them to a HTTPS server and see if this problem is solved. You may be running into some security-related issue, for running some of these APIs like getUserMedia from the file system has shown weird behavior.


#47

I didn’t want this to be the way, because I like the idea of being able to use it when not connected to the internet, but putting it on a website and the exact same html/files now works.

Will try to see if I can have the frameset local with the texts, but the actual webcame on the website and see if it still works.


#48

You can totally do this without relying on the internet by by running a web server on your local machine. One popular option is http-server: https://www.npmjs.com/package/http-server

Let me know if you need any further guidance on this :slight_smile: