简体   繁体   English

Xamarin iOS WkWebView 和 WebRTC 麦克风在后台不起作用

[英]Xamarin iOS WkWebView and WebRTC microphone not work in background

I´m using WkWebView in Xamarin for iOS to show a webapp WebRTC based.我在Xamarin for iOS中使用WkWebView来展示基于 WebRTC 的 webapp。 My app uses WebRTC to call other app and I´m using only audio.我的应用程序使用 WebRTC 来调用其他应用程序,而我只使用音频。 The app works perfectly, but:该应用程序运行良好,但是:

First problem I´m facing is when the app goes to background, outcoming audio (iPhone microphone) is muted, but incoming audio still continues working.我面临的第一个问题是当应用程序进入后台时,传出的音频(iPhone 麦克风)被静音,但传入的音频仍在继续工作。 App does not disconnect and the webview does not freeze, only microphone is muted.应用程序没有断开连接,webview 没有冻结,只有麦克风静音。

I have noticed something different when open my app in Safari: the iOS status bar changes its color and shows that microphone is being used, while when in my app (using WkWebView) this not happens.当我在 Safari 中打开我的应用程序时,我注意到一些不同的事情:iOS 状态栏改变了它的颜色并显示正在使用麦克风,而在我的应用程序中(使用 WkWebView)则不会发生这种情况。 Also, Safari not mutes the microphone in background.此外,Safari 不会在后台将麦克风静音。

Am I forgetting something in WkWebView config?我是否忘记了 WkWebView 配置中的某些内容?

在此处输入图像描述

We reproduced this issue in native Apple and tried to add UIBackgroundModes "audio" and "voip" in info.plist to see if they make a difference.我们在原生 Apple 中重现了这个问题,并尝试在 info.plist 中添加 UIBackgroundModes "audio" 和 "voip" 以查看它们是否有所作为。

Unfortunately, they did not.不幸的是,他们没有。 So this is an Apple / WebKit issue.所以这是一个 Apple / WebKit 问题。 We found a thread on Apple's forum talking about the same issue with a webRTC app in WKWebView: WKWebView getUserMedia microphone … |我们在 Apple 论坛上发现了一个帖子,讨论了 WKWebView 中 webRTC 应用程序的相同问题: WKWebView getUserMedia 麦克风… | Apple Developer Forums .苹果开发者论坛

Also, there is a WebKit bug report as well: 233419 – WKWebView microphone access not working in background (webkit.org) .此外,还有一个 WebKit 错误报告: 233419 – WKWebView 麦克风访问无法在后台工作 (webkit.org) So please follow up with them.所以请跟进他们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM