NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: rjolda on October 20, 2023, 10:42:39 AM

Title: Net Talk Camera selection
Post by: rjolda 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
Title: Re: Net Talk Camera selection
Post by: Bruce 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

Title: Re: Net Talk Camera selection
Post by: rjolda on October 23, 2023, 02:15:08 AM
Thanks Bruce,
Ron