Jeffrey Basurto
Jeffrey Basurto

Reputation: 1465

using react-native webview component, can the website access the camera and audio of the device?

I am unable to get the web-view component in React Native to access the device camera and audio when loading a html5 website that requires camera/audio to take a video via the front-facing camera.

I have tried using the solution from https://github.com/facebook/react-native/issues/11610 however, the web-view still cannot access the camera/audio function

<View style={{flex: 1,backgroundColor:color.main_background}}>
  <NavBar navigation={this.props.navigation}>

   <WebView
      source={{uri:url }}
      javaScriptEnabled={true}
      />
 </NavBar>
</View>

Upvotes: 0

Views: 1285

Answers (1)

Chris Geirman
Chris Geirman

Reputation: 9684

If you can base64 serialize the data, then seems like you should be able to use this component to send data to your Webview. Not sure how performant it would be though.

https://github.com/R1ZZU/react-native-webview-messaging

Upvotes: 1

Related Questions