NetTalk Central

Author Topic: Net Talk Camera selection  (Read 2545 times)

rjolda

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Email
Net Talk Camera selection
« on: October 20, 2023, 10:42:39 AM »
Hi
Using NT 14.07  Clarion 11.0.136
When taking a photo with a mobile phone - I remember Bruce showing I think a button which allowed the end user to be able to switch between Front and Back camera depending on what they wanted to take a photo of.
I tried setting up a Button but that did not work.
Anyone can supply details on how to allow the end user to change the camera on their mobile phone that they are wanting to use?
Thanks,
Ron

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Net Talk Camera selection
« Reply #1 on: October 22, 2023, 11:56:37 PM »
In the template:
Add a button to your form.
Set the button type to be "Webcam".
On the "On click" tab, set the Action to "Switch Camera".

In server-side code:
p_web.script('$("#somefield-camera").ntcam("switch")')

In JavaScript code

$("#somefield-camera").ntcam("switch");

You can also force a specific camera by setting the parameter to "user" or "environment". As in

p_web.script('$("#somefield-camera").ntcam("switch","user")')

$("#somefield-camera").ntcam("switch","environment");

Cheers
Bruce


rjolda

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Email
Re: Net Talk Camera selection
« Reply #2 on: October 23, 2023, 02:15:08 AM »
Thanks Bruce,
Ron