mind-ar-js icon indicating copy to clipboard operation
mind-ar-js copied to clipboard

[bug] Switching orientation breaks the AR

Open marcusx2 opened this issue 3 years ago • 6 comments

If I switch the orientation on the phone from portrait to landscape and vice versa, the augmented content disappears permanently.

marcusx2 avatar Aug 10 '22 20:08 marcusx2

Apparently this bug was already reported here. Will it be fixed? This is a pretty big deal...I can't use mindarjs in production like this.

marcusx2 avatar Aug 10 '22 20:08 marcusx2

@hiukim Any thoughts on this? Will it be fixed, or are there currently no plans to fix it?

marcusx2 avatar Aug 14 '22 23:08 marcusx2

Yes, currently it will break if device changes orientation. I agree it needs to be handled. I will look into it when I have some free time.

hiukim avatar Aug 15 '22 00:08 hiukim

Ah ok. For now I'll need to use zappar. ARJS' image tracking is just not good enough, and switching orientation is really important for production. I can't just tell the client not to switch orientations T_T. I hope this gets fixed soon.

marcusx2 avatar Aug 15 '22 03:08 marcusx2

@hiukim Will this be fixed soon? ;_;

marcusx2 avatar Sep 15 '22 14:09 marcusx2

@marcusx2 sorry, unlikely. At least not these two weeks. Busy with work lately.

hiukim avatar Sep 15 '22 18:09 hiukim

Is there any workaround while this isn't fixed?

marcusx2 avatar Oct 26 '22 23:10 marcusx2

@marcusx2 try this:

window.addEventListener('orientationchange', () => {
 //stop mindar
 mindar.stop()

 //ur function to hide 3D object (optional)

 //restart mindar after 1 second delay
 setTimeout(()=>{
  mindar.start()
 }, 1000)

}, false)

Not the most elegant way, but as a temporary solution it may help.

P.S. I know, this is deprecated event, but it still work on iOS 16. So we can use that until @hiukim not fix this bug

arslc avatar Nov 12 '22 23:11 arslc

@arslc Thanks this is a good enough workaround, it works just fine!

marcusx2 avatar Dec 14 '22 22:12 marcusx2

@marcusx2 Glad it helped :) @hiukim Probably should be closed issue?

arslc avatar Dec 15 '22 11:12 arslc

@arslc I don't think it should be closed. I think we should be able to rotate the phone without having to stop and start the AR engine again. This is still just a workaround in my opinion.

marcusx2 avatar Dec 15 '22 14:12 marcusx2

fixed in v1.2.2

hiukim avatar Jun 04 '23 09:06 hiukim