I'm not sure if this is the right place to ask, but I have a problem with my devicemotion
script.
I have some code that runs when the page is loaded to check if there is a gyroscope available or not. I do this in the following way:
function check_user_hardware(){
if (mobile_size <= 600) {
hidden = true;
}
console.log("checking hardware");
giro_timer = setTimeout(update_gyro_value, 30);
window.addEventListener("devicemotion", function(event){
console.log("device motion?");
if(event.rotationRate.alpha || event.rotationRate.beta || event.rotationRate.gamma){
calculate_rotation_mesh_pos(event.rotationRate.beta, event.rotationRate.gamma);
if (!gyroscope) {
gyroscope = true;
console.log("gyroscope here");
current_interaction_mode = 'gyroscope_option';
set_user_ui_elements();
}
}else{
followMouse = true;
console.log("no gyroscope here");
current_interaction_mode = 'followMouse_option';
set_user_ui_elements();
window.addEventListener('mousemove', get_user_mouse_pos);
}
});
}
This worked just fine a few weeks ago, but now it is not working anymore. I see in console the following prints:
checking hardware
and thats it. Why isn't my devicemotion event firing?
Even on my website with basic SSL encryption it is not working, why?
Do I need some sort of special SSL encryption?
What is this happening?
All suggestions are welcome!
If more information is needed I will be happy to provide.
You can see the website in question here: gravient.thomashoek.com