Conversation
package.json
Outdated
| ], | ||
| "dependencies": { | ||
| "custom-event-polyfill": "^1.0.6", | ||
| "custom-event-polyfill": "^1.0.7", |
There was a problem hiding this comment.
Better to not touch dependencies. Only upgrade when necessary.
There was a problem hiding this comment.
I agree; and also, if package.json is updated, it will likely require moving forward the aframe version number. That said, if you use a clean machine and git clone the repo, you will find a number of issues with the current package.json file that makes updating pieces of it problematic. Can anyone else verify with a clean machine that package.json is stable? Thanks!
There was a problem hiding this comment.
Travis (our CI) machine does that per commit and haven't heard of any issues. Better to revert the package.json file to the original version and address any issues in a seperate PR
There was a problem hiding this comment.
I've reverted the package.json and resolved all the other issues described. The big remaining question is, do we want to have a temporary or permanent visible icon on the bottom left, the way it is now; or, do we want to have a full screen interrupt, similar to 8thwall or vr-mode-ui when you are in portrait mode, to question device-motion-permission? I believe it is ready to be checked in.
There was a problem hiding this comment.
Thanks for the hard work. I would say we want a modal dialog similar to 8thwall or vr-mode-ui. Button is easy to miss and hard to understand what it's for. We can apply and reuse vr-mode-ui style for consistency.
|
|
||
| schema: { | ||
| enabled: {default: true}, | ||
| enableFunc: {default:''} |
There was a problem hiding this comment.
These are in flux and are not yet implemented. They may not belong in the final PR on this. I will revisit before resubmitting.
| */ | ||
| module.exports.Component = registerComponent('device-motion-permission', { | ||
|
|
||
| dependencies: ['canvas'], |
There was a problem hiding this comment.
This dependency might not be necessary for this component
|
Thanks for doing this.. So far the code approach looks sensible. I haven't been able to test it on device yet. |
|
Update on this: I found that iPad works for Firefox and Safari: in both cases, the applications had Desktop Version Requested. You either needed to set the preference in your preferences, or select the aA icon in the left of the location for Safari; or the three dots on the right side of Firefox, to Request Mobile Site. That means that what I have done is working across the target browsers on iOS and iPad browsers; I believe that it will also work on Android devices as well (not tested on many). The controller is in the bottom left of the screen to ask permission. For android devices, you will not need to select it. https://planetkevin.com/aframe/examples/showcase/device-motion-permission/a.html |
|
The last thing remaining from development perspective is getting past Travis. It is erring out on code that was written before me which I do not believe my code impacts. Is there something I am not understanding on this? |
|
Matching Travis requirements, pulling out identified linting errors. Last big remaining item, making the modal screen attractive. Currently, Cancel and Continue buttons are functional. My idea: a Built with Aframe logo and wording that tells users that permission is required for device motion. I can continue with this, or if anyone else has an idea of what can be included here graphically, that could also be helpful. |
|
Thanks for all the hard work! It's coming along pretty well. I made a few style changes to match linter style, |
|
|
||
| function createDeviceMotionPermissionWindow (onClick, obj) { | ||
| var wrapper, innerWrapper, aframeBuilt; | ||
| var cancelBtn, continueBtn; |
There was a problem hiding this comment.
We do one variable declaration per line and we avoid abbreviations: cancelButton and continueButton
| module.exports.Component = registerComponent('device-motion-permission-ui', { | ||
| schema: { | ||
| enabled: { default: true }, | ||
| request: {default: {orientationChange:null, deviceOrientation:null}}, |
There was a problem hiding this comment.
Does this need to be configurable via schema? Do we need to handle deviceOrientation events explicitly or we can just rely on CSS?
There was a problem hiding this comment.
No, that was inadvertently left in from something earlier. What is now in place is the single component with the potential for one or both orientation events (device orientation and orientation change). The example on my site has two simple functions attached through the attributes, orientation-change and device-orientation. The drawback that I have on their usage at this point is that they use the window object to reference the functions. I'll hopefully get this done tomorrow with your edits. Thanks for your attention.
https://planetkevin.com/aframe/examples/showcase/device-motion-permission/a.html
|
Just about complete. Has new modal screen; will add clickable to it later today (November 14th) |
| this.onDeviceMotionClick = bind(this.onDeviceMotionClick, this); | ||
| this.onOrientationChangeClick = bind(this.onOrientationChangeClick, this); | ||
| this.grantedDeviceMotion = bind(this.grantedDeviceMotion, this); | ||
| if (typeof window.orientation !== 'undefined') { |
There was a problem hiding this comment.
This if statement can be simplified to:
if (DeviceOrientationEvent && DeviceOrientationEvent.requestPermission) {
this.deviceMotionEl = createDeviceMotionPermissionDialog(this.onDeviceMotionClick, this);
this.el.appendChild(this.deviceMotionEl);
}
See suggested edits
There was a problem hiding this comment.
The reasons for the structure here follow. I have tried these in different browsers and devices, including multiple iOS versions. There are other ways to do this, but going too simple or too complex will lead to similar outcomes. Thoughts?
iOS13
- DeviceOrientationEvent.requestPermission needs to be called, not only tested to exist;
iOS and Android
- grantedDeviceMotion is called by mobile devices (window.orientation)
Desktop Browsers
- Do not call grantedDeviceMotion
There was a problem hiding this comment.
DeviceOrientationEvent.requestPermission is already called when the user clicks on the allow button in the onDeviceMotionClick method
Do we need to call it twice?
lf think if DeviceOrientationEvent.requestPermission is not available we don't need to call any additional methods or initialize the dialog. Everything should work as before. iOS 12 requires user to enable DeviceMotion manually in settings, iOS < 12 will work as it used to.
|
Great job! Thanks for sticking with it. I made a few change suggestions. This is getting really close. |
|
Just pushed latest updates; with comments and most all critiques included. |
|
thanks @KevinEverywhere! FYI I tested out your demo on Android 9 Chrome browser (& also on iOS 13 Safari), works well! |
|
Thanks a lot everybody for the hard work and the testing. I adjusted a bit the code style to the rest of A-Frame, removed some redundant logic and tweaked the visual style of the modal dialog. I tested on iOS 13.2 on iPhone X and Chrome m78 on a Pixel 3 with Android 10. I don't have an iPad handy at the moment to test with. If you can let me know if it works and what you think about the dialog it'll be appreciated. The PR is almost ready. We only need docs for the |
|
@dmarcos , will you want me to complete this: the readme, for instance. Also, I had one last test that is not included here. iPad OS 13 defaults to Request Desktop Website. A person with an iPad would not know that this fails without having feedback. my solution is below. I tested on a number of devices and operating systems, desktop and mobile. This took over 40 hours of time to resolve something that kept aframe content from being functional on iOS/iPad 13 devices. Thanks. isMobile: function() { The other place this would be used is after the window.orientation check: |
|
Adding iPad to |
|
@dmarcos am grabbing my iPad now and cloning the PR to test |
|
@subelsky and @dmarcos; if anyone can post the output file for testing, that would be great. If either you or anyone else can compare what already is up at the URL below to work on all target browser/devices; I think that the cardboard/fullscreen worry will be mooted. Also, you can test your iPhone against this. Currently, if your iPhone is set to Desktop Website Requested, you do not have feedback to let you know. What I have is reverse compatible and covers iOS/iPad and Android. https://planetkevin.com/aframe/examples/showcase/device-motion-permission/b.html |
|
@KevinEverywhere here's what I did: that gave me an SSL URL like |
|
attached is the build file which I produced via: hope that helps! this feature is going to be awesome for a couple of projects, PSYCHED |
|
I changed the |
|
Looks great, @dmarcos; checked it on iPad Pro with iPad 13 installed with Mobile and Desktop Website Request and it worked as expected on both. The build from 71009c4 is the aframe-aframe.js file used here: https://planetkevin.com/aframe/examples/showcase/device-motion-permission/c.html |
5549a62 to
0aa50be
Compare
…ents. Co-authored-by: Kevin Ready <kevin.ready@gmail.com> Co-authored-by: Diego Marcos <diego.marcos@gmail.com>
0aa50be to
540b7e1
Compare
|
Documented and tested! Shipping 🚢 Thanks everybody for the hard work. |
|
@dmarcos : Is this feature coming with 0.9.3 on 6th december? |
|
Yes but you can use it today via master builds: https://cdn.jsdelivr.net/gh/aframevr/aframe@934b8d358a2c458efdc8d65fcb6946f7303f0b51/dist/aframe-master.min.js Let us know if you have any issues |
|
Works very well! Is there any chance this will be included in Aframe 0.8.2? Since the breaking change of a-animation in V0.9.2 my code does not work in that version, and I see no real possiblity to upgrade it in the near future. I suspect a lot of people will stay with 0.8.2 for the coming months/years because of this breaking chance |
|
@tommensink Unfortunately, We don’t patch previous releases. It’s not sustainable to maintain multiple versions. Can you elaborate on the breaking change that it’s preventing to upgrade to 0.9.2? a-animation got replaced by the animation component but the API is the same. It should be easy to upgrade. I recommend testing master now in anticipation of 0.9.3. Browsers are deprecating WebVR in favor of WebXR and outdated experiences will stop working in VR mode. |
|
Thanks, and I understand. It is just that I use a-animation a lot and would not know where to begin to replace it in my code, since I use a nested structure with some sort of animation sequencer that I made. You can see it in https://hh-webar.firebaseapp.com/Presentation_2019-01-26/. (Just let the head rotate on your screen to see the different transparancy sequences kicking in). |
|
My personal opinion is that moves from Apple like this motion-issue (which of course also can be understood, but nevertheless) and breaking Aframe changes will throw it back for some years to be adopted by the professional market. I for one will do the major serious AR/VR projects in Unity and use Aframe only for gadgets like dancing business cards |
|
As a developer, the choice between narrower proprietary (higher paying) and
open-source (open, agreed-upon standards) solutions is never-ending. I
disagree with the idea that this throws aframe back years. It merely drives
innovation and should keep us vigilant and on our toes. It will be the
community as much as the vendor that will keep technologies current.
Nothing against Unity or profit-motive companies. I just like the idea of a
large and common playing field.
…On Sat, Nov 23, 2019 at 8:30 AM Tom Mensink ***@***.***> wrote:
My personal opinion is that moves from Apple like this motion-issue (which
of course also can be understood, but nevertheless) and breaking Aframe
chances will throw it back for some years to be adopted by the professional
market. I for one will do the major serious AR/VR projects in Unity and use
Aframe only for gadgets like dancing business cards
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4303?email_source=notifications&email_token=AAE5AJPTQY3UA6KK5MQCAO3QVFLBLA5CNFSM4JI23MD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE7YT2I#issuecomment-557812201>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE5AJOW2N4EKEEROIGHHPTQVFLBLANCNFSM4JI23MDQ>
.
|
|
I hope I don't hijack this thread for this discussion too much, but one last thing then: You should hear me about breaking changes in Unity or their horrific tight integration of libraries like Vuforia (who break the API every release). But having said that, I am a full time AR developer, make dozens of apps as lead developer in four AR startups, including one of the first to do actual brain surgery with a HoloLens. So I have to choose the most appropriate and stable Entity Component Framework regularly. Funny moves like this one from Apple (and we had something similar on Android beginning of the year which requires the user to change a setting jeromeetienne/AR.js#369 (comment)) is one reason to choose another platform that will keep running no matter the OS change. An issue like this means that I will judge again in one or two years for Aframe in critical apps, hence my "Aframe is thrown back years" by this. Also if the Aframe community decides they should make breaking changes to the API like a-animation, then this does not work in favour of this decision. Just my opinion, do think the major companies have similar considerations, but cannot speak for them. The actual main issue here I think is that Apple and Google will never break their normal apps, or they issue warnings in ample time for developers to change their code, yet they make WebXR changes to their browsers without any warning. This is a vicious circle: when AFrame and WebXR become more important, they will be more cautious too. But for this we have to make more apps in AFrame and WebXR. But I think you guys are awesome, this solution is great Kevin (I applied your first one which works with V0.8.2) and I always support AFrame in discussions and presentations as THE best open platform. |
…ation events. (aframevr#4303)" This reverts commit 2124261. # Conflicts: # docs/components/device-orientation-permission-ui.md # src/components/scene/device-orientation-permission-ui.js
…ation events. (aframevr#4303)" This reverts commit 2124261.


Description:
iOS 13 introduced new permissions requirements for device motion and orientation. This PR enables iOS 13 Safari users to use device motion.
Changes proposed:
Recommended Todo
The second recommended todo is to proactively give user feedback that their device motion will be part of their experience. Depending on its function, this could have different opacity or color.