AmbientLightSensor
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
环境光传感器 API 的 AmbientLightSensor
返回一个用于访问 AmbientLightSensorReading
的接口。
实例
AmbientLightSensor.AmbientLightSensor()
-
创建一个新的 AmbientLightSensor
对象。
属性
AmbientLightSensor.reading
-
返回一个
AmbientLightSensorReading
接口,包含当前光的亮度级别。
Examples
js
// TBD
规范
Specification |
---|
Ambient Light Sensor # ambient-light-sensor-interface |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
AmbientLightSensor | ||||||||||||
AmbientLightSensor() constructor | ||||||||||||
illuminance |
Legend
Tip: you can click/tap on a cell for more information.
- No support
- No support
- Experimental. Expect behavior to change in the future.
- See implementation notes.
- User must explicitly enable this feature.
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.