Closed irislovely closed 6 years ago
I have encountered this issue as well. We have not been able to solve the problem. Additionally the video element keeps getting made by ar-js as 3k x 1.5k....way larger than the available real-estate of the phone screens we are testing on, which overflows our whole page.
:-/
Hi @sloumdrone , I fix it by myself: if your
have this:<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
Please remove this line. I don't have time to test which parameter cause it, but I remove the line and everything work well. has anyone else resolved this? it is driving me insane.
@danburk @irislovely 's solution works for me.
someone understood what is the cause of that? I have the same problem and don't have on my HTML the line @irislovely posted
I was also facing this issue. But the position was strange for me on android as well as windows. For me, i found that arjs adds offset to the model position if there are any other html elements on the page like divs/buttons/text etc. The model and marker aligns perfectly only when there is no other element other than scene inside body.
I'm having this issue on android too. I'm trying to run arjs in a nuxt app which I guess is the problem as it runs fine within a simple html app. Does anyone have any more info on what specifically causes it? I've followed all the above suggestions
So here's a weird thing that I just discovered... If I force a window resize (either via code or rotating the phone) everything works...
Additional notes... I've found an alternative fix which is to replace this:
<meta name="viewport" content="width=device-width,initial-scale=1.0">
with this:
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
Only tested on android and chrome.
This solution works. thanks!
Additional notes... I've found an alternative fix which is to replace this:
<meta name="viewport" content="width=device-width,initial-scale=1.0">
with this:
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
Only tested on android and chrome.
This only partially worked for me. It got rid of the zoom, but the video now had left offset.
I fixed this by calling window.scrollTo(0, 0);
after arToolkitSource.onResize();
is called.
Issue reproduces for me after page refresh (weirdly enough, first page load is ok), for https://stemkoski.github.io/AR-Examples/hello-cube.html on Chrome 86.0.4240.110, Android 9 (Pixel 3)
I've been struggling with this for one week.
On iPhone, everything is working perfectly. But on Android, the model always display far away from the marker, mostly on the top , nearly out of the phone screen.
Does anyone encounter this issue too?