Permission denied getUserMedia(

I receive this error when implementing the example of the documentation … among other errors

  1. MediaStreamError {name: “SecurityError”, message: “Permission denied.”, constraintName: undefined}

  2. constraintName: undefined

  3. message: “Permission denied.”

  4. name: “SecurityError”

  5. proto: Object

Have you tried using react-native-permissions ?
Check it at https://github.com/react-native-community/react-native-permissions

For example on componentDidMount() try

Permissions.request('camera').then((response) => {
  if (response === 'authorized') {
    // here you can use your MediaStream code...
  }
});

Let me know if it works.

1 Like