Android相当于ImageRecorderIOS.openCameraDialog

问题描述 投票:0回答:1

在iOS上启动本机相机UI进行照片/视频录制我们使用ImageRecorderIOS.openCameraDialog - https://facebook.github.io/react-native/docs/imagepickerios.html#opencameradialog - 它有成功和错误回调。这将启动本机相机UI并在回调中获取照片/相机/取消。

我在文档周围挖了一下看看反应本机是否有任何开箱即用的东西在Android中我找不到它,我错过了什么吗?

所以我找了第三方库,我找到了react-native-camera然而这创造了一个我必须在<View>中嵌入的视图,我必须创建我自己的控件。然后我找到react-native-image-picker这是完美的照片,但它不支持视频 - https://github.com/react-community/react-native-image-picker#directly-launching-the-camera-or-image-library - 这启动原生相机,但它只允许我“照片”而不是“视频”。 :(有没有人有本地Android视频taing的任何第三方模块?

android ios video react-native camera
1个回答
1
投票

您可以使用Intent启动默认的相机应用程序并从中接收照片或视频。详细信息可以在这些指南中找到:https://developer.android.com/training/camera/photobasics.html https://developer.android.com/training/camera/videobasics.html

尝试根据它们编写解决方案,如果您有任何问题,请回来。

© www.soinside.com 2019 - 2024. All rights reserved.