Skip to content

Conversation

@MrBlenny
Copy link

@MrBlenny MrBlenny commented Feb 12, 2017

deviceorientation does not give absolute aka 'world' positioning on android chrome anymore. This PR fixes that.

I'm not sure if this breaks 'game' positioning in any way. This should be tested.

@FREEZX
Copy link

FREEZX commented Nov 12, 2017

This breaks support for firefox mobile, with the error DeviceOrientation is not supported.
Works fine on the original. I'm usinig the bundled js file along with gyronorm.

if (event.absolute === true) {
orientationChangeAbsolute = true;
}
if (event.absolute == orientationChangeAbsolute) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaks support for non-absolute browsers, like firefox mobile


if ( sensors.orientation.active ) {

window.removeEventListener( 'deviceorientationabsolute', handleDeviceOrientationChange, false );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix issues with firefox mobile, needs to be like this

				if ('ondeviceorientationabsolute' in window) {
					window.addEventListener( 'deviceorientationabsolute', handleDeviceOrientationChange, false );
				} else if ('ondeviceorientation' in window) {
					window.addEventListener( 'deviceorientation', handleDeviceOrientationChange, false );
				}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants