6 Replies Latest reply on Oct 8, 2014 12:52 AM by Patrick Simons

    Error trying to access Rho.Camera

    Remco van 't Land

      Hi all,

       

      We recently were asked to allow the MC40's and TC55's being used by our client to make pictures and send those. Expecting this to be a simple feature in Rho I started off but soon ran into problems.

       

      This is the code:

      <script type="text/javascript" charset="utf-8" src="Javascript/rhoapi-modules.js"></script>

      <script language="javascript">

      function TakePicture() {

          try {

              var pCam = { desiredWidth: 768, desiredHeight: 1024 };

              Rho.Camera.take_picture(pCam, HandlePicture(e));

          } catch (err) {

              alert(err);

          }

      }

       

      function HandlePicture(params) {

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

              Rho.Camera.saveImageToDeviceGallery(Rho.Application.expandDatabaseBlobFilePath(params["imageUri"]));

          }

      }

      </script>

       

      Triggering the TakePicture() function returns the caught error: "TypeError: 'undefined' is not an object (evaluating 'Rho.Camera.take_picture')


      The camera seems unavailable in the object:

      RhoScreenshot.png

      The camera is under "capabilities" in the Build.yml.

       

      Any suggestions would be very welcome, thanks in advance!