I could play a bit with it. seems that the WKWebView 'default' config doesn't allow for inline Media
The config property to be changed is "allowsInlineMediaPlayback (from HERE)
And the way to change the B4i webView configuration from HERE (latest post)
If you are adding the Webview by code, this snippet contains all the needed info. If you are loading the webView in a layout, you should proceed as it is done in the 2nd link's latest post ( remove webview from parent, initializecustom, and add again). Tested, works
B4X:
Dim conf As NativeObject
conf = conf.Initialize("WKWebViewConfiguration").RunMethod("new", Null)
conf.SetField("allowsInlineMediaPlayback", 1) '<- This is the line that makes the difference
WV.InitializeWithCustomConfiguration("WV", conf)
mParent.AddView(WV,0,0,width,height)
WV.LoadUrl("https://webrtc.github.io/samples/src/content/devices/input-output/")
It's strange. Without the hack I get a black frame and with it, it works
In my case I am adding the wwebView by code.
I have iOS 15.4.1 but I don't think that it will make any difference.
If you can post or send me a small project where it doesn't work, I'll check it. I'm sure it must be a small detail somewhere.
I added it dynamically, not even the link I sent you works for me.
B4X:
Dim conf As NativeObject
conf = conf.Initialize("WKWebViewConfiguration").RunMethod("new", Null)
conf.SetField("allowsInlineMediaPlayback", 1) '<- This is the line that makes the difference
WebView1.InitializeWithCustomConfiguration("WebView1", conf)
Panel1.RemoveAllViews
Panel1.AddView(WebView1, 0, 0, Panel1.Width, Panel1.Height)
Yesterday's test was with a big project of mine that I had opened at that moment. Here you are a small example with just the Web+cam
You'll need to update the package name, certificate and provisioningProfile with your own values
Thanks for the guide, however I think that in B4i, it should be working with the example that Jordi provided, however it was not, if you have any additional recommendations it would be great.
Or someone who has experienced this problem?
Perhaps Erel himself, will there be any other solution?
Worth checking if this is the case and if available, update to a newest beta to check if they fixed the issue. Or, in the worst case, you can downgrade to iOS 15.6 until iOS16 is stable.
In other posts, they talk about VoiceOver (from accessibility settings) being active (which can happen after an OS upgrade) can interfere with camera usage.