HTML5 DeviceAPIs不起作用(返回null)

问题描述 投票:1回答:2

我有这个代码window.ondeviceorientationabsolute = (e) => console.log(e);

在两种设备(PC和手机)中,它确实输出{ alpha: null, gamma: null, beta: null }

我有点困惑,我从来没有使用设备apis,我不知道是否有一些权限丢失

非常感谢你的帮助

javascript android html html5
2个回答
0
投票

window.ondeviceorentationabsolute实际上没有任何基于this developer site的支持


0
投票

API当设备没有相应的传感器时返回null。

© www.soinside.com 2019 - 2024. All rights reserved.