Xamarin IOS WKWebView和WebRTC麦克风在后台不起作用

发布于 2025-02-13 05:27:07 字数 540 浏览 1 评论 0 原文

我使用 wkwebview in xamarin ios 以显示基于WebApp WebRTC的。我的应用使用WebRTC调用其他应用程序,而我仅使用音频。该应用程序效果很好,但是:

我面临的第一个问题是当应用程序进入后台时,音频播音(iPhone麦克风)被静音,但是传入的音频仍在继续工作。应用不会断开连接,并且网络浏览不会冻结,只有麦克风被静音。

在Safari中打开我的应用程序时,我已经注意到了一些不同的东西:iOS状态栏会改变其颜色,并表明正在使用麦克风,而在我的应用程序(使用WKWebView)中,这不会发生。另外,Safari不会在背景中静音麦克风。

我在WKWebView配置中忘记了一些东西吗?

I´m using WkWebView in Xamarin for iOS to show a webapp WebRTC based. My app uses WebRTC to call other app and I´m using only audio. 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. App does not disconnect and the webview does not freeze, only microphone is muted.

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. Also, Safari not mutes the microphone in background.

Am I forgetting something in WkWebView config?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

两相知 2025-02-20 05:27:07

我们在本地苹果中复制了此问题,并试图在info.plist中添加uibackgroundModes“ audio”和“ voip”,以查看它们是否有所作为。

不幸的是,他们没有。因此,这是一个Apple / Webkit问题。我们在苹果论坛上找到了一个线程,讨论了WKWebView中的WebRTC应用程序:

另外,还有一个webkit错误报告: 233419 - wkwebview microphone casscect out Backgack not (webkit.org)。因此,请跟进他们。

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.

Unfortunately, they did not. So this is an Apple / WebKit issue. We found a thread on Apple's forum talking about the same issue with a webRTC app in WKWebView: WKWebView getUserMedia microphone … | Apple Developer Forums.

Also, there is a WebKit bug report as well: 233419 – WKWebView microphone access not working in background (webkit.org). So please follow up with them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文