Code Monkey home page Code Monkey logo

Comments (6)

lukkysam avatar lukkysam commented on July 18, 2024

I solved the problem, listening to the events "pause" and resume".

document.addEventListener("pause", function () {
    if (Camera.isActive) Camera.stop();
}, false);
document.addEventListener("resume", function (e) {
    if (Camera.isActive) Camera.start();
}, false);

, where

var Camera = {
    start: function () {
        var tapEnabled = true;
        var dragEnabled = true;
        var toBack = true;
        this.isActive = true;
        return cordova.plugins.camerapreview.startCamera({
            x: 0,
            y: 0,
            width: window.innerWidth,
            height: window.innerHeight
        }, "back", tapEnabled, dragEnabled, toBack);
}, ....

from cordova-plugin-camera-preview.

julitroalves avatar julitroalves commented on July 18, 2024

I have same issue! @lukkysam your solution doesn't work for me. :/

from cordova-plugin-camera-preview.

THMah avatar THMah commented on July 18, 2024

any update on this??

from cordova-plugin-camera-preview.

westonganger avatar westonganger commented on July 18, 2024

Can anyone confirm if this is still ocuring with the master version of this plugin.

from cordova-plugin-camera-preview.

pisti2 avatar pisti2 commented on July 18, 2024

I have almost the same problem. When application goes into the background then goes back, it crashes. There are 2 exceptions in the log
when it goes into the background:

com.cordovaplugincamerapreview.Preview.surfaceDestroyed(Preview.java:230)

and when it goes back and crashes:

com.cordovaplugincamerapreview.Preview.surfaceCreated(Preview.java:219)

The error is: Camera is being used after Camera.release() was called

The app is running under Android 5.1.1

from cordova-plugin-camera-preview.

THMah avatar THMah commented on July 18, 2024

Tested with latest master branch.
This issue is fixed.

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.