2 Replies Latest reply on Feb 15, 2019 9:35 AM by Felix-Antoine Carignan

    EB api Camera autofocus

    Felix-Antoine Carignan

      Im using TC8000 device with EB 1.6

       

      I am able on a web page to open camera and take picture, but the autofocus doesn't seems to work.

      When i use android camera apps, autofocus work fine. But it doesn't work with EB.

       

      Any ideas ?

       

      Thnaks you.

        • Re: EB api Camera autofocus
          Joydeep Chakraborty

          Can you please share the script you are using?

          Regards,

          Joydeep

            • Re: EB api Camera autofocus
              Felix-Antoine Carignan

              I'm using basically the same exemple as in the API docs.

              EB.Camera.TakePicture open up a camera apps, but without any control and I cannot change the focus. Seems to focus at infiny always.

              When I use the google camera android apps, auto focus is working when you move the cam.

               

              Here is both main js function.

               

              function take_picture_with_default_camera() {

                 //EB.Camera.choosePicture({},picture_taken_callback);
                // Capture an image from the default camera on the device, using the default image settings
                 EB.Camera.fileName = createImgFilename();
                 EB.Camera.takePicture({'outputFormat': 'image'}, picture_taken_callback);
              }

               

              function picture_taken_callback(params) {

                 if(params != null){

                 if (params["status"]=="ok") {

               

                 var imguri = 'http://localhost:'+EB.System.localServerPort + params["imageUri"];

                 //Sauvegarde l'image dans la liste
                 var tmp = [EB.Camera.fileName,imguri];
                 local_images.push(tmp);
                 addImgToCarousel(EB.Camera.fileName, imguri);
                 }

                 else if(params["status"]=="error"){

                AjaxPopup.ShowPopup("Erreur", params["message"]);
                 }

                }

              }