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

Issue with Camera on iOS 13 and Safari Browser #90

Open
kalwalt opened this issue Feb 7, 2020 · 10 comments
Open

Issue with Camera on iOS 13 and Safari Browser #90

kalwalt opened this issue Feb 7, 2020 · 10 comments

Comments

@kalwalt
Copy link

kalwalt commented Feb 7, 2020

I report an issue from my repository kalwalt/kalwalt-interactivity-AR#9
It seems that camera is not working properly with iOS 13, video start but suddenly is stopped.
@huynhthanhnhan if you want maybe add other details, maybe we can try to fix this.
@nicolocarpignoli @ThorstenBux have you an idea?

@lucasmatheustesta
Copy link

Hi, can you inform me if this problem happens only with the version "13"? Because I have a iPhone 7 version 13.3.1 and I can't reproduce the error. I saw the thread in "kalwat-interactivity-AR#9".

Is your iPhone a new one?

@kalwalt
Copy link
Author

kalwalt commented Apr 9, 2020

@lucasmatheustesta i don't know. I can not test on iPhone, my only devices are Android based. It could that in some cases it is required more memory? Anyway i added the -s ALLOW_MEMOR_GROWTH in the build script, see the PR #96 it will be merged soon.

@szabadimiklos
Copy link

I tried the nft_improved_worker example (https://github.com/artoolkitx/jsartoolkit5/blob/master/examples/nft_improved_worker/threejs_worker_gltf.html) on Windows/Chrome and Android/Chrome, and it works perfectly, but on an iPhone 7 running iOS 13.3.1 in Safari the problem still occurs, after a few seconds the page reloads itself, so it actually works for a brief time, but then it suddenly stops and reloads the page. I don't have problems with the wasm version so far on any devices (https://github.com/artoolkitx/jsartoolkit5/blob/master/examples/nft_threejs_wasm.html), but i wanted to use the nft_improved_worker example, because it has that nice movement smoothening.

@kalwalt
Copy link
Author

kalwalt commented May 8, 2020

Can you try the version in https://github.com/webarkit/jsartoolkit5 ? It should have the allow_memory_growth option that may help...

@szabadimiklos
Copy link

For me, this didn't solve the problem, it acts the same way: works for a few seconds (with quite low FPS), then safari reloads the page.

@szabadimiklos
Copy link

Update: I've updated the iPhone 7 from iOS 13.3.1 to 13.4.1 and the problem has gone, now it's working well!
Also might be interesting to know: now it's working with both versions (I mean the one with allow_memory_growth, and the one without it works the same for me now)
Another interseting thing is that on az iPhone 6s with iOS 13.3.1 (so with the same iOS version than it was on the iPhone 7 before the update) everything is working well, so this problem - for me - seems like a very device AND os specific iOS bug.

@Davidwang007
Copy link

I am now use iPhone 11,iOS 14 beta 1,when use jsARToolKit,the camera start but suddenly stopped as above talked,but Android chrome without any problem, so how to solve it ? thank you .

@JohnnyJimJams
Copy link

JohnnyJimJams commented Aug 21, 2020

Android is working fine for me. iOS 13.6 (iPhone X) on safari wasn't working. The camera would freeze.

Reloading/refreshing the page fixed the issue every time. First page load would freeze, second and subsequent page loads would work.

I suspected the camera permissions were the issue. Apple require user interaction to access the camera.

I added a launch button and it works on iOS consistently now.

I changed the last portion of code here in this file: jsartoolkit5/examples/nft_threejs_wasm.html

This bug is making me second guess my own sanity.

I very occasionally see an issue on PC, where "if (window.ARController && ARController.getUserMediaThreeScene) {" never runs.

When I attempt to log a bunch of stuff, I can't reproduce the issue. Race condition somewhere? Heisenbug? What the?

On iOS I see (again occasionally) the same bug where that code is never run. I also see a second bug when that code does run, but the camera freezes on the first frame.

@Davidwang007
Copy link

@JohnnyJimJams ,Have you solve the problem yet ?

@rievez
Copy link

rievez commented Nov 25, 2020

Had the same issue on iPhoneX os14.2 .
Tried the fix from the repo and at last find out that it seems to be a common bug for getUserMedia with ios.
A solution from here works : cozmo/jsQR#185 (comment)
Thank you guys for making this great library and repo ,it works perfectly on Android and Ios now like charm!

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

6 participants