dorukeker / gyronorm.js

JavaScript project for accessing and normalizing the accelerometer and gyroscope data on mobile devices
MIT License
642 stars 65 forks source link

Doesn't work with Chrome's emulation on desktop #10

Closed greggman closed 9 years ago

greggman commented 9 years ago

Chrome has device orientation emulation in their DevTools

chrome-device-orientation

But gyronorm fails the promise. I have no idea if there's a workaround or if this is a bug in Chrome itself that it's maybe not advertizing support? In any case it would be nice if there was a way to use gyronorm this way as it's really useful to debug.

greggman commented 9 years ago

Hmmm, I just noticed Chrome updated to 43.0.2357.130 (64-bit) on OSX and the behavior seems to have changed. Now I have the opposite problem which is the promise resolves when I'm in standard desktop mode with no orientation available when I'd prefer it reject :disappointed:

greggman commented 9 years ago

Ok, more ... I guess you're looking for some change in values which makes sense since the sensors usually jumble. So I found write after I start my app if I rotate the emulator within a second or so the promise resolves, if not it rejects. I guess that's fine as a workaround.

dorukeker commented 9 years ago

Hello,

Starting from v2.0.0, gyronorm is build up on FullTilt. So this is the same issue that was discussed here: https://github.com/Full-Tilt/Full-Tilt/issues/7

I have updated gyronorm to use the latest version of FullTilt. The issue with the Chrome dev tools still remains (just like it is for FullTilt). However you can debug using doe.

Here you can see the gyronorm demo in doe (https://dorukeker.github.io/gyronorm_on_doe)

Cheers, Doruk

dorukeker commented 9 years ago

BTW the project with flowers and butterflies is very nice :+1: