I receive this error when implementing the example of the documentation … among other errors
-
MediaStreamError {name: “SecurityError”, message: “Permission denied.”, constraintName: undefined}
-
constraintName: undefined
-
message: “Permission denied.”
-
name: “SecurityError”
-
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