emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.82k stars 3.31k forks source link

DeviceMotion & OrientationChange reporting NOT_SUPPORTED #3411

Closed pixelnerve closed 5 years ago

pixelnerve commented 9 years ago

Hello, I'm just testing these 2 options and i'm getting a not supported from the set callback. Are these implemented or still under the works ?

thanks

juj commented 9 years ago

The return value NOT_SUPPORTED means that the browser you are running it in does not support the features. See https://github.com/kripken/emscripten/blob/master/src/library_html5.js#L1155 and e.g. http://www.sitepoint.com/using-device-orientation-html5/ . Can you check if your environment actually does support those features?

pixelnerve commented 9 years ago

I'm testing on 3 devices, iphone, nexus7 and note4. All with latest Safari, Chrome and Firefox.

I wrote a small test using js and it reports success for OrientationChange.

Using Emscripten 1.30 the only one that returns success is DeviceOrientation. Both others DeviceMotion and OrientationChange report not supported.

pixelnerve commented 9 years ago

I've used window.orientation and window.onorientationchange. Not sure why the window.screen and addEventListener to window.screen check on the function.

pixelnerve commented 9 years ago

https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation It says screen.orientation is experimental and is not supported on anything other than firefox.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.