I am using the following javascript code to display device orientation information in a webpage/console:
if(window.DeviceOrientationEvent) {
window.addEventListener('deviceorientation', function(event) {
var yaw = event.alpha;
var pitch = event.beta;
var roll = event.gamma;
...
}, false);
}
If I run this code in the Edge browser on Windows, the orientation information updates at a fast and constant rate. However, in Chrome, the orientation information does not refresh smoothly. If I open a compass app in the background on Windows 10 (Asparion Compass+), then the refresh rate increases in Chrome.
Does anyone know why this happens? And is there any way to increase the device orientation refresh rate in Chrome (without having apps running in the background)? There are other features in Chrome that I want to use in this project, so using Edge is not an option.
Note, I have also tried using AbsoluteOrientationSensor({frequency: 100})
, but the device orientation information that is output to the webpage/console does not refresh at 100Hz.