Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NityaSantosh26 opened this issue Dec 7, 2023 · 0 comments

Comments

@NityaSantosh26
Copy link

NityaSantosh26 commented Dec 7, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant