Giter Club home page Giter Club logo

Comments (8)

ricardokrieg avatar ricardokrieg commented on May 29, 2024

+1 for this

I would like to show a loading page while the camera isn't ready.

from cordova-plugin-camera-preview.

erperejildo avatar erperejildo commented on May 29, 2024

Not sure if I understood the question but the only thing you have to check if is Cordova/phone is ready, startCamera and takePicture

from cordova-plugin-camera-preview.

mm108 avatar mm108 commented on May 29, 2024

hi,

Say I have a page with a button to start the camera preview plugin. Once I call the startpreview method it takes a little amount of time for the camera to initialise - and this seems to depend on the device itself. So I was wondering if there is an event that fires when the camera has been initialised and ready for snapping the picture. What I would want to do then is to snap a picture. Hope that explains it - Cheers - M&M

from cordova-plugin-camera-preview.

erperejildo avatar erperejildo commented on May 29, 2024

Hmm... haven't faced problems related with this. Could you try creating a callback in the startpreview function?

from cordova-plugin-camera-preview.

mm108 avatar mm108 commented on May 29, 2024

hi,

I think I did try that earlier. I am a littles less acquainted with the cordova and stuff so I am not sure if I didn't do it right but I do remember having tried a callback and it didn't fire. Any pointers will be greatly help. Thanks once again

from cordova-plugin-camera-preview.

erperejildo avatar erperejildo commented on May 29, 2024

Well, for this the only thing you need I think is js so maybe doing something like this:

CameraPreview.startCamera({
      x: 0,
      y: window.innerHeight/2 - window.innerWidth/2,
      width: thatPhoto.windowWidth,
      height: thatPhoto.windowWidth,
      camera: "back",
      tapPhoto: false,
      previewDrag: false,
      toBack: false
    }, function(options, success, error) {
       // do something
});

And in www/CameraPreview.js something like:

CameraPreview.startCamera = function(options,onSuccess, onError, callback){
// ...at the end

f (typeof callback === "function") {
    // Call it, since we have confirmed it is callable​
        callback(options, onSuccess, onError);
    }

That should work (haven't try sorry, I'm at work)

from cordova-plugin-camera-preview.

mm108 avatar mm108 commented on May 29, 2024

Cool. Thanks a ton. I will test and update on the outcome 👍 Cheers - M&M

from cordova-plugin-camera-preview.

westonganger avatar westonganger commented on May 29, 2024

There are success callbacks on everything in master now. Closing

from cordova-plugin-camera-preview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.