-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
screenOrientationAngle is not reliable #9
Comments
It seems like when we first set the screen orientation angle from window.screen.orientation or window.screen.orientation.angle that the platform is initially returning zero (or null) when the device is in a non-zero screen orientation angle. That is incorrect platform behaviour in my understanding. Which device, OS and browser are you currently using? Can you load the following page in the landscape screen orientation and let me know what value it reports? |
Thank you very much for your feedback. I wasn't able to reproduce the issue with the jsfiddle for now since the issue isn't consistent. Previously I used an iPhone 4 running iOS8 and a Nexus 5 running Lollipop. |
I am not sure if this is related with what you experience. I have seen devices return unexpected values if the compass of the device is not calibrated well. You can try to open the compass app and see if it works as expected. I hope this helps. |
I think I've found the problem here. So, if the orientation has changed between page load and |
Hi there,
First thank you, you're doing great!
I'm trying to create a controller on mobile for a desktop based experience.
My objective is basically to deduce directions from accelerometer values so if we're tilting the phone left, right, front or back we can move accordingly on the desktop.
Most of the time, it works well. But sometimes, my devices returns miscalibrated values.
It's actually related to screenOrientationAngle returning 0. If I trigger manually an orientation change by moving the device to portrait and move back to landscape, the value gets fixed (something like 90 or 270 is now returned) and the adjustment is right.
I know that those values are based on natives window.screen.orientation or window.screen.orientation.angle and that it's not directly related to Fulltilt.
Do you have an idea of how I could fix it?
I hope I was clear enough!
The text was updated successfully, but these errors were encountered: