5 ms·
The motion detection takes place in the browser with JavaScript which analyzes and quantifies RGB value differences. HTML5 takes care of the camera. An email se
by pixeltwenty 9y ago
The motion detection takes place in the browser with JavaScript which analyzes and quantifies RGB value differences. HTML5 takes care of the camera. An email server is still required - HTML5 doesn't cover that of course. This works with up-to-date Firefox, Chrome, Edge, and Opera browsers on Windows, Mac, and Android (the OS specific browsers running as applicable on various platforms). I am currently aware of just Safari and iOS on iPhone/iPad not working - the camera view shows all black and I have not yet attempted to solve.
- blacksmith_tb 9y agoWhat if js could handle sending email via Mailgun, Sendgrid etc.? Then it could be self-hosted (though you may not want it to be, of course).
- pixeltwenty 9y agoThanks for the ideas. One thing I have wrestled with in the past is how to prevent exposing the third party site email credentials (credentials the page would utilize for accessing Sendgrid, etc.) if the emailing code were hosted in the local and observable JavaScript. With the current server solution, at a minimum the browser and CORS enforcement take care of attempted cross domain access ... which is probably just slightly better than nothing at all.
- j_s 9y agoLet end users provide their own third party site email credentials.
- pixeltwenty 9y agoI like that idea. It could be an alternative, an additional option.
- randomString1 9y agoYou could use something that is not e-mail. From uploading the images to a shared/cloud folder and/or a messenging protocol to notify you.
- DougWebb 9y agoIt might be useful to get it running on headless Chrome, so it can run completely server-side. There's probably better ways to do that, but it could be fun.
- untog 9y agoI've not used it, but there's a node-webcam module: https://www.npmjs.com/package/node-webcam https://www.npmjs.com/package/node-webcam That you could presumably pair with node-canvas (or something similar) to achieve the same results without a browser needing to be involved.