question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Camera on iOS only available if webview is recreated

See original GitHub issue

Bug description:

With allowsInlineMediaPlayback enabled and mediaPlaybackRequiresUserAction disabled (this one was a problem on Android), after we ask for camera access on iOS, the camera simply does not load.

After we restart the app, the user is prompted with the webview’s request to access the camera (not the SO one, but the one the browser does). And it works.

To Reproduce:

  1. Render the webview.
  2. Send a postMessage to ask native code to request camera permission.
  3. Grant permission.
  4. Webview’s getMediaDevices() fail.

Expected behavior: Webview should be able to get media devices.

Environment:

  • OS: IOS
  • OS version: 14.6
  • react-native version: 0.63.4
  • react-native-webview version: ^11.2.4

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:17

github_iconTop GitHub Comments

3reactions
DiogoAlexandrocommented, Aug 26, 2021

Hi @wmaca same problem here, have you already solved?

2reactions
mawakicommented, Feb 21, 2022

@wmaca please check the video in the link below to see if it will help.

https://www.youtube.com/watch?v=GAHWt2HPEIM

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Webview (camera, getUserMedia) double ...
This allows iOS to remember the permission decisions and get rid of the initial double-prompt by inheriting the grant from the native layer....
Read more >
Access camera and microphone in WKWebView
I am trying to access camera and microphone in WKWebView. I tried many ways but it didn't work. I tried injecting js in...
Read more >
Android Platform Guide - Apache Cordova
When the user navigates back to your application, the Activity and Webview will be recreated by the OS, but state will not be...
Read more >
Release Note | UniWebView
An issue which causes web view's Url property not parsing correctly when it contains some special characters. # Deprecate. The original iOS-only toolbar...
Read more >
Android Widgets | Home Assistant Companion Docs
If you notice that a widget is no longer working try to recreate it. ... Available widgets​. Camera​. This widget will update every...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found