简体   繁体   中英

React Native - Is this possible to access the camera by using the CameraRoll Api?

I am working on my app project which also deals with the camera, photos & videos. I want to use the standard APIs not third party developers APIs, by standard APIs i mean those APIs which are documented on the react native official website .

I found CameraRoll API in the documentation and my question is whether it is possible to achieve the following using this API?

  • Access Photos & Videos
  • Select Photos & Videos
  • Open camera and take Photos & Record Videos

I am sure about the first two that we can achieve, but doubtful about the third. Can anyone tell that can we achieve the third by using CameraRoll API?

  • Yes
  • No
  • No

The documentation clearly says what the API can and can't do. getPhoto() will only return a promise containing an array with image information, no actual images. You'd have to implement a custom viewer. And it can't access the camera, only stored files.

If that's what you want to do react-native-image-picker is your best friend.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM