Skip to content

Need a method stop() to close the Camera or PhotoLibrary from code. #874

@NityaSantosh26

Description

@NityaSantosh26

Feature Request

Motivation Behind Feature

It's really helpful to have a control to close the resources like CAMERA or PHOTOLIBRARY.
UseCases:

  • If resources are being used for more than limited time, we can close them automatically.
  • Push Notifications, While Capturing if there's a notification, then we need to close the camera automatically from code rather than manually clicking on close button.

Feature Description

It's just a new method which is supposed to close the CAMERA or PHOTOLIBRARY from code.
By calling this method, it closes the resources and resumes the app to it's initial state.

Alternatives or Workarounds

For me, It's a blocking issue as it's supposed to close the CAMERA automatically but that's not the behavior with the plugin as there's no method available to close it.
So the implemenation of the stop() for both Android and iOS is needed.

I can contribute by implementing the stop() which closes the resources from javascript. By calling navigator.camera.stop() which works for both android and iOS.

Here's a PR that I have created. Please go through the implementation.
https://github.com/apache/cordova-plugin-camera/pull/873

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions