Ar.js: change camera on mobile

Created on 12 Jun 2017  ยท  8Comments  ยท  Source: jeromeetienne/AR.js

how is possible change the camera in rear camera from front camera ?

Most helpful comment

Actually the issue is more likely to be that facingMode isn't available in the version of Chrome for Android that you might be using. I happen to have two Galaxy S8's for development but mysteriously one worked (Chrome v59) and the other one I just received did not (Chrome v56). I tracked it down to issue #290161 in Chromium bug tracker which is now marked as fixed. So, it's just a chrome version issue.

Thankfully that means you have two easy fixes:

  • Use a polyfill, https://github.com/webrtc/adapter. I can confirm this poly worked for me in Chrome v56. Particularly useful if your app is already out in the wild and living in production.
  • Upgrade Chrome on your device (better if you have control over your environment like I do).

๐Ÿ‘๐Ÿ˜Ž

All 8 comments

sorry i dont understand. can you elaborate ?

i need to change the camera where i read the patter in my phone from front camera to a back camera like in this video https://www.youtube.com/watch?v=0MtvjFg7tik&feature=youtu.be

any help?

@jeromeetienne I'm having the same issue. The Hiro demo is cool but on a Nexus 6p it defaults to front facing camera pointed at me, not the rear camera making the demo sorta pointless. My main day-to-day phone is an iphone so idk how to switch front-facing camera for rear-facing in chrome on android.

i have a nexux6p at home and it load the demo without issue on the bend
camera

On Sat, Jul 8, 2017 at 3:46 PM Stephen Tetreault notifications@github.com
wrote:

@jeromeetienne https://github.com/jeromeetienne I'm having the same
issue. The Hiro demo is cool but on a Nexus 6p it defaults to front facing
camera pointed at me, not the rear camera making the demo sorta pointless.
My main day-to-day phone is an iphone so idk how to switch front-facing
camera for rear-facing in chrome on android.

โ€”
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/jeromeetienne/AR.js/issues/96#issuecomment-313859948,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAPcIqd3AbJbaoVRA6AB-eCOZsXrTkOtks5sL5ZXgaJpZM4N3S9p
.

Thanks for the quick reply @jeromeetienne. First and foremost, I appreciate your effort on trying to bring web ar to the world faster :). I really want to engage with AR.js, if for me it constantly just defaults to front facing camera I'm not sure what else I should be doing. Any tips? I'm continuing developing an AR.js demo for myself as well but am presuming I'll hit the same issue where it only uses front facing camera.

You to change the facing mode into environment if you want change the camera

Actually the issue is more likely to be that facingMode isn't available in the version of Chrome for Android that you might be using. I happen to have two Galaxy S8's for development but mysteriously one worked (Chrome v59) and the other one I just received did not (Chrome v56). I tracked it down to issue #290161 in Chromium bug tracker which is now marked as fixed. So, it's just a chrome version issue.

Thankfully that means you have two easy fixes:

  • Use a polyfill, https://github.com/webrtc/adapter. I can confirm this poly worked for me in Chrome v56. Particularly useful if your app is already out in the wild and living in production.
  • Upgrade Chrome on your device (better if you have control over your environment like I do).

๐Ÿ‘๐Ÿ˜Ž

Was this page helpful?
0 / 5 - 0 ratings

Related issues

freinbichler picture freinbichler  ยท  27Comments

markleeyw picture markleeyw  ยท  37Comments

nicolocarpignoli picture nicolocarpignoli  ยท  27Comments

ks1505 picture ks1505  ยท  22Comments

MP619212 picture MP619212  ยท  59Comments