React project, non-Native, how to call the camera based on codeova?

the react project created by Dva, combined with Cordova, is ready to encapsulate hybrid App. I want to use the cordova plug-in to call the camera. Is there any way to implement it?

May.04,2022

access to non-webview functions under cordova is done through plug-ins. For cameras, you can take a look at cordova-plugin-camera. Of course, there are many camera-related plug-ins to refer to. Basic usage:

  1. install the plug-in cordova plugin add cordova-plugin-camera
  2. modify the js code to call the plug-in according to the plug-in documentation. For the use of the above plug-in, please refer to the official website https://cordova.apache.org/do....

window.navigator.camera.getPicture (cameraSuccess, cameraError, cameraOptions)

Menu