我在加载html5网站时无法获取react react中的Web视图组件,以访问设备摄像头和音频,该网站需要摄像头/音频通过正面拍摄视频相机。
我尝试使用https://github.com/facebook/reaect-native/issues/11610的解决方案,但是,Web-View仍然无法访问摄像头/音频函数
<View style={{flex: 1,backgroundColor:color.main_background}}>
<NavBar navigation={this.props.navigation}>
<WebView
source={{uri:url }}
javaScriptEnabled={true}
/>
</NavBar>
</View>
如果您可以base64序列化数据,那么似乎应该能够使用此组件将数据发送到WebView。不确定表现如何。
https://github.com/r1zzu/react-native-native-webview-messaging