Can you guess the JavaScript tech used?

by Mate Marschalko

I was experimenting the other day and came up with this demo. I want to find out if anyone can guess the JavaScript technology used. If you have an idea comment at the bottom of this page or go to Twitter or Facebook to join the conversation.

Thanks for visiting this page. To this question the solution has already been found and been published under: Predict hand distance with the JavaScript device light API

6 thoughts on “Can you guess the JavaScript tech used?

  1. Kogsworth says:

    Either he used the proximity sensor or his ring is activating the magnetic sensors. Or it’s fake.

  2. Not a bad guess but no. The proximity sensor can only see objects from 0 – 10cms away. Also, it only returns yes or no so you can’t detect distances accurately. Regarding the magnetic sensor: there’s no JavaScript API to access this sensor as of yet.

  3. Marcus Setchell says:

    I would of said HTML5 getUserMedia() possibly checking the brightness of the data from the webcam by drawing to a canvas and reading pixels?

  4. Ian Brennan says:

    As it looks like you’re using Firefox, I’d take a stab at saying its using the devicelight event

    https://developer.mozilla.org/en-US/docs/Web/API/DeviceLightEvent

    http://caniuse.com/#feat=ambient-light

  5. Marcus, that sounds like a great idea. It is definitely a possible solution. However, Ian has the right answer!

  6. I agree with Marcus. Camera with getUserMedia() + canvas drawing. Years ago flash developer use some technique call “Image difference” to see if something has cahnged between two images, one taken “now” and another 10 or 100 ms latter. Maybee this is a clue .

Leave a Reply