+ window.addEventListener("<a href="https://developer.mozilla.org/en-US/docs/Web/Events/devicelight">devicelight</a>", this.lightEvent, true);
+ window.addEventListener("<a href="https://developer.mozilla.org/en-US/docs/Web/Events/deviceproximity">deviceproximity</a>", this.proxEvent, true);
+
+ lightEvent: function(lightData) {
+ lightData.value (in lux)
+ },
+ proxEvent: function(proxData) {
+ proxData.min <= .value <= .max (in cm)
+ },
+
+ window.removeEventListener("devicelight", this.lightEvent, true);
+ window.removeEventListener("deviceproximity", this.proxEvent, true);
+
+ // flash/torch code works via <a href="https://developer.mozilla.org/en-US/docs/Web/API/CameraManager.getCamera">navigator.mozCameras.getCamera</a>
+ // flaky and subject to change, please consult code on github