【问题标题】:Is it possible to use the front and back camera in react-native in the same time?是否可以同时在 react-native 中使用前置和后置摄像头?
【发布时间】:2018-05-31 16:17:47
【问题描述】:

我使用 npm 包 react-native-camera,我希望看到您在进行 WhatsApp 视频通话时的视图,但仅使用您自己的摄像头。

我希望我的后置摄像头全屏显示,而前置摄像头作为另一个小组件。

这是在我的 render() 方法中:

return (
  <View style={styles.container}>
    <RNCamera
        style={styles.back}
        type={RNCamera.constants.Type.back}>
    </RNCamera>
    <RNCamera
        style={styles.front}
        type={RNCamera.constants.Type.front}>
    </RNCamera>
  </View>
);

但总是只有第一个摄像头在运行。

它在 MacOS 上,我在 iPhone SE 设备上运行它。

【问题讨论】:

    标签: ios react-native react-native-camera


    【解决方案1】:

    根据来自 Apple 的AVFoundation Programming Guide,这似乎是不可能的:

    注意:媒体捕捉不支持同时捕捉 iOS 设备上的前置和后置摄像头。

    【讨论】:

    • 它仍然相关吗
    猜你喜欢
    • 2012-09-05
    • 1970-01-01
    • 2014-09-28
    • 2012-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-24
    相关资源
    最近更新 更多