Skip to content
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

a-canvas not always fullscreen in iOS Chrome #3282

Closed
tomegz opened this issue Dec 12, 2017 · 2 comments
Closed

a-canvas not always fullscreen in iOS Chrome #3282

tomegz opened this issue Dec 12, 2017 · 2 comments

Comments

@tomegz
Copy link
Contributor

tomegz commented Dec 12, 2017

Description:
Scene doesn't take up whole screen. Even if it does initially, it breaks after changing device's orientation. In Safari it works alright - i expierienced it only on Chrome iOS. Chrome version: 62.0.3202.70
25344290_1651791048206153_1585761493_o

  • A-Frame Version: 0.5.0, i also expierenced it on my own demos with 0.7.0 version
  • Platform / Device: iPad Air 2
  • Reproducible Code Snippet or URL: https://aframe-gallery.glitch.me/
@tomegz
Copy link
Contributor Author

tomegz commented Dec 12, 2017

I haven't dug into A-Frame's source code but it may be caused by fact that "orientationchange" event doesn't come with correct values at first (maybe just on iOS Chrome) - they update slightly after the event is emitted - hence it's resizing to wrong size. In my demos i have my own ui which resizes on "orientationchange" event - to prevent this from happening i would use something like this:

function orientationChanged() {
  const timeout = 120;
  return new window.Promise(function(resolve) {
    const go = (i, height0) => {
       window.innerHeight != height0 || i >= timeout ?
       resolve() :
       window.requestAnimationFrame(() => go(i + 1, height0));
      };
      go(0, window.innerHeight);
  });
}

And use it like this:

orientationChanged.then(function() { 
  resize();
});

@arturitu
Copy link
Contributor

It seems that the cause is known webkit bug: https://bugs.webkit.org/show_bug.cgi?id=170595

dmarcos added a commit to dmarcos/aframe that referenced this issue Dec 17, 2017
dmarcos added a commit to dmarcos/aframe that referenced this issue Dec 17, 2017
dmarcos added a commit to dmarcos/aframe that referenced this issue Dec 17, 2017
dmarcos added a commit to dmarcos/aframe that referenced this issue Dec 17, 2017
dmarcos added a commit to dmarcos/aframe that referenced this issue Dec 17, 2017
dmarcos added a commit to dmarcos/aframe that referenced this issue Dec 17, 2017
dmarcos added a commit to dmarcos/aframe that referenced this issue Dec 17, 2017
dmarcos added a commit to dmarcos/aframe that referenced this issue Dec 17, 2017
dmarcos added a commit to dmarcos/aframe that referenced this issue Dec 17, 2017
dmarcos added a commit to dmarcos/aframe that referenced this issue Dec 17, 2017
dmarcos added a commit to dmarcos/aframe that referenced this issue Dec 17, 2017
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

No branches or pull requests

2 participants